CHAPTER 1 INTRODUCTION
1.3 Thesis Organization
This thesis is organized as follows. In chapter 2, we review the previous related researches about brush models, ink diffusion and color display. Then we compare the proposed system with current commercialized painting packages. We describe the system overview, including system framework and user interface in chapter 3. Chapter 4 describes models and algorithms for color ink painting, dividing into three sections: brush models, ink diffusion and color display. We show some implementation results in chapter 5, including some imitated paintings and original paintings using the proposed system. Then we have some discussions on these results. Finally, chapter 6 concludes this work and addresses some future works to improve our work.
Chapter 2 Related Works
We will discuss some previous works related to Chinese Ink Painting on three main topics, which are brush model, ink diffusion and color representation. Then we will compare our system with current commercial painting packages.
2.1 Brush Model
To simulate brush motions and to get realistic results on the paper, an appropriate brush model should be defined. Strassmann [20] proposed a brush model to simulate the traditional Japanese art of sumi-e, where brush strokes are created by sweeping a one-dimensional brush bristle over a skeleton. Suguru Saito and Masayuki Nakajima [18] provided a three-dimensional physically-based brush model that allows users to draw strokes on a computer with a pen-type input device. A two-dimensional brush model was proposed by Shan-Zan Weng at el. [25].The region where the brush contacts the canvas is circle-shaped (which can be considered as a footprint) and the bristles are distributed uniformly in it. To
create a stroke, they proposed an algorithm to extract the skeleton of a stroke and let the center of the brush model move along with it. The orientation of the brush during movement was taken into consideration to make the generated strokes look natural and smooth. Finally, the footprints of the bristles would be taken as the path of ink contribution on the canvas.
With different types of brush selected, different styles of strokes can be generated. Wong and Ip [27] used an inverse cone to represent the virtual brush. In the DAB [8] project, they used a particle system to represent their brush geometry. Xu et al. [28] proposed a two-level hierarchical geometry model. They used three B-spline curves to control the three-dimensional brush geometry.
Some of the brush models mentioned above are defined in 2D while the others are defined in 3D. As to the brush models defined in 2D, another curve need to be defined to represent the path of the brush: a spline curve evaluated by control points. Since the proposed system in this thesis is an interactive system, the brush path is determined by users. We don’t need to define another skeleton to represent the path. Besides, brush models defined in 3D often have to simulate the brush motion, which will require a lot of system resources. After considering system speed and the presented effects, we define our brush model in 2D. The detailed brush model will be discussed in section 4.1.
2.2 Ink Diffusion
The special effect of ink diffusion is produced by the incredible absorbency of Hsuan paper. Ink diffusion is widely used in Chinese ink painting and it is also what differentiates Chinese ink painting from western painting. A technique proposed by Lee [17] efficiently rendered oriental black ink paintings with realistic diffusion effects. The system proposed by Lee can simulate ink diffusion based on a variety of paper types and ink properties. However, there has been no mechanism presented about the simulation of blending effects of two or more strokes. Small [19] proposed a parallel approach to predict the motion of pigment and water on the paper, which computes the status in each paper cell repeatedly to achieve realistic diffusion effects. A more sophisticated paper model was proposed by Curtis and Anderson [9]. With a more complex shallow water simulation, they can simulate realistic diffusion effects of watercolor. Sheng-Wen Huang et al. [13] proposed a physically-based ink diffusion model by simulating the interaction among water particles, carbon particles and paper. This model is the main reference for the ink diffusion simulation in this thesis. By making some modifications and extensions to Huang’s model, we can achieve the requirement for an interactive system. Detailed ink diffusion model will be discussed in section 4.2.
2.3 Color Representation
The importance of colors in Chinese Ink Painting is no less than ink diffusion effects.
Previous researches on Chinese Ink Painting all focus on black ink painting, and they rarely discuss the simulation of color pigments. In DAB project [8], they simulated color mixture on the canvas and used a simple alpha blending to get the colors from two different pigments in two layers. The system proposed by Xu [28] also used a simple alpha blending to show the color mixture. Curtis and Anderson [9] used Kubelka-Munk theory, which researches on the light reflection and transmission between pigments and paper, to compute the color of a stroke
painted on another stroke. Another work that used KM theory is proposed by Chet S. Haase et al. [12]. They used this theory to compute a variety of color mixtures of pigments. Since KM theory can display the color of the mixed pigments realistically, our system also use it to compute the display of colors. Details will be discussed in section 4.3.
2.4 Survey of Commercialized Painting Packages
Among current commercial painting packages, a system similar to ours is COREL’s Painter, which doesn’t need stroke skeleton information such as spline curve. This is why we compare our system with Painter on the simulation of Chinese Ink Painting. In Painter, the simulation results of watercolor and oil painting effects are realistic, but there is only a calligraphic brush Sumi-e that simulates the effects of Chinese writing brushes. The Sumi-e brush in Painter can create calligraphic strokes but it is unable to achieve the ink diffusion effects in Chinese Ink Painting. Our system, however, complements this defect.
Chapter 3 System Overview
3.1 System Architecture
OpenGL is the graphic API used in our proposed system. We use glDrawPixels to render the final color of each pixel. The flow of the whole process is shown in Figure 3.1 below.
When strokes are drawn on the screen using tablet, the system will put all the pixels drawn into a queue. Then the system serves the queue as an input for the ink diffusion thread. At this time, the system processes the ink diffusion thread and render the color of each pixel computed by KM model in a parallel process way. By processing the ink diffusion thread and refreshing screen at the same time, the current progress of the system is noticeable and the idle time is greatly reduced.
Figure 3.1 System Architecture, the system processes the ink diffusion thread and computes the color by KM model in a parallel process way.
3.2 User Interface
The system provides a user interface using the GLUI user interface library. Users can choose brush type, pigment type and different ink concentrations. The basic functions such as load canvas, save canvas and save canvas as a bitmap file (*.bmp), and undo the last stroke are provided. Besides, by adjusting the stroke parameters such as colors, size, water volume, and carbon volume, users can achieve various painting effects.
Figure 3.2 User Interface
Figure 3.3 Strokes with different concentrations.
Left to right: from thin to thick.
(a) Simulated image.
(b) Real image.
Figure 3.4 Comparison between real and simulated various ink concentration.
We also simulate the painting sequence from observations of real painting behaviors, such as drawing after dampening the paper to achieve the diffusion effects. In real world, if we apply water on paper, the wet area would appear darker because of the light reflection and transmission in paper. The water effect is provided for users to show whether an area on the paper is wet or not. Also, the wet area would dry out gradually as time elapses, as shown in Figure 3.5.
Figure 3.5 (a) The effect of wet area on paper. (b) Dry brush drawn on a wet area. (c) Left: the stroke of (b) after the canvas dries. Right: Dry brush drawn on dry area.
.
Chapter 4
Models and Algorithms for Color Ink Painting
The painting media (Chinese writing brush and Hsuan paper) used in Chinese Ink Painting are very different from those in western painting. In order to create the combining effects of these two media, we have to simulate their properties. We propose a simple brush model with two different types to simulate the strokes of Chinese writing brush. In ink diffusion, we reference Huang’s [13] ink diffusion model but makes some modifications. As to the color display of the pigments, we adopt the KM theory.
4.1 Brush Model
There are two types of brush model in our system, both of them are simple models defined in 2D. The first type is normal brush, which includes median thick brush and thick brush in Chinese writing brushes. The brush bristle are randomly distributed in a circle of radius size (an integer value; the radius of the largest pressure of input) and the number of points representing the bristle is the area of the circle (πr2=π∙size2). Users can change the
size of the circle by applying different input pressures while dragging the circle to form the bristle effects at the same time, as shown in Figure 4.1.
Figure 4.1 Normal brush. The brush bristle are randomly distributed in a circle of radius size (the radius of the largest pressure of input) and the number of points representing the bristle is the area of the circle (πr2 =π∙size2)
The second type is contour brush, which is the thin brush of Chinese writing brush and is used to depict the contours or details of an object. Contour brush is constructed by filling every pixel in a circle of radius size to represent the brush bristle. Also, users can input different pressures to change the size of the circle and drag the circle to form the effect of contour strokes. Since there are some coarse results from extremely small stroke size, e.g.
smaller than 3, we apply a simple anti-aliasing process to smooth the strokes with a mask to filter all the pixels in the strokes. Figure 4.2 shows the strokes of the two brush types and Figure 4.3 shows the corresponding mask.
Figure 4.2 (a) Normal Brush and (b) Contour Brush.
Figure 4.3 Anti-aliasing mask. The coefficients are the most appropriate results for contour brush strokes.
4.2 Physically-based Model of Ink Diffusion
When the brush bristles touch the surface of the paper, the ink in the bristles begins to flow inside the paper. The high absorbency of the paper and different quantity of water cause different diffusion effects, such as strokes with their edges flurry and blurred. These diffusion features represent complex physical phenomena which cannot be completely simulated by conventional graphical techniques such as texture mapping or the creation of degradation functions, since purely mathematical method generally results in flatly blurred images which are different from realistic diffusion images.
4.2.1 Ink Diffusion Phenomena
Capillary phenomenon, a physical mechanism, is an important factor that causes the ink diffusion in the paper structure. In Figure 4.4, a thin tube is placed in a container filled with water with one end in the water and the other end in the air. The liquid will rise inside the tube and the liquid surface inside the tube is higher than the surface of the outside water. This phenomenon can also be observed in the ink diffusion in paper. The typical paper is composed of fibers which are positioned in random position and random direction in which small holes
area, and create diffusion, as shown in Figure 4.5.
Figure 4.4 The capillary phenomenon.
Figure 4.5 The real ink diffusion effect.
4.2.2 Discrete Paper Model
Although the diffusion phenomenon is a continuous physical phenomenon, the simulation of the diffusion phenomenon in computer is discrete. Therefore, the paper model is defined in a discrete 2D array of [X × Y] paper cells. Each paper cell is called a papel [16], as shown in Figure 4.6. The papel is a basic unit of the paper structure and corresponding to a pixel on the screen.
Figure 4.6 Discrete paper model. The paper cells are named papels (Courtesy of Huang).
According to Huang’s [13] definition, each papel has some properties. Absorbency (p), the ability of absorbency of the papel p is defined as following. When the moving ink pass through p with N fibers lay in, the quantity of water left and deposited in p is Q. The relationship between Q and N can be represented as
N
Q∝ . (1)
According to the previous research proposed by Lee [16], the number of the cross points of fibers in the paper is the most important factor to the ability of absorbency. If the number of cross points of fibers is Cn, then the relationship between Cn and Absorbency (p) is
) ( p y Abosorbenc
Cn∝ . (2)
Cn
N ∝ , (3)
Then we obtain the following relationship:
Q N p
Absorbency( )∝ ∝ . (4)
Based on the relationship of (4), we can define many kinds of paper model with different ability of water absorbency with different densities of paper fibers. The initial ability of absorbency of each papel can be described as
() )
(p Base Var rand
Absorbency = + × (5)
where Base and Var are real numbers between zero and one, and rand() is a function which produces number between 0 and 32767. In Figure 4.7, we simulate different ink diffusion effects with different kinds of absorbency of paper. The coefficient of the ability of water absorbency is represented as a real number between zero and one.
Figure 4.7 Three simulated ink diffusion image represent different kinds of paper.
4.2.3 Discrete Ink Model and Ink Flow
The black ink in Chinese ink painting is a dilute mixture of water and colloidal carbon particles. The carbon particles are much smaller than those of watercolor paints such that they can diffuse into paper along with the absorbed water. Besides the capillarity, the forces acting on the motion of ink involve the interaction between waters and waters, waters and carbons and the gravity, etc. To simulate chaotic and complex motion of ink in fibers, we separate the ink into two kinds of particles: water particles and carbon particles. [26]
Water Particle
In Huang’s [13] definition of water, the water volume is divided into particles for the characteristic of discrete-computing ability of computers. All of the water particles are defined as objects that have uniform volume and uniform mass. The only different property of the water particles is their positions, which recorded the index of the papel they are at.
With the definition of water particles, we can decide the movement of these particles on paper. When the water in a certain papel is decided to flow out, the quantity and direction of the water to flow out are the two characters must be figured out. Based on some physical knowledge and hypothesis, the approximate equation of K(p), the ratio of the quantity of water to flow out to the quantity of water contained in the papel p is represented as
( )
(
1 1 ( ) 2)
)
(p Base Var Absorbency p
K = + × − − , (6)
where Base is a real number between zero and one to represent the basic flow rate of p, and
Var is a real number between zero and one to represent the difference between the highest flow rate and the lowest flow rate.
The reason for the ability of ink diffused in paper is the capillarity only on water particles, not on carbon particles. Based on this phenomenon, we have to decide the direction of the diffused water flowing out, which is decided by predicting the probabilities of the water particles. This method will be discussed in section 4.2.4.
Carbon Particle
Carbon particles don’t move like water particles. Instead, if the force produced by the energy of the movements of the water particles is larger than the force produced by the friction of the carbon particles, the carbon particles move with the water particles. According to Huang’s [13] definition, carbon particles have some attributes such as mass, position, diameter and color. But all of these attributes are not uniform, which is different from water particles. The diameter and mass of a carbon particle is decided according to the fineness when grinding the ink initially. If the initial ink grinding is coarse, the ink contains small and large particles which produce an observable change of color intensity along the border line of the initial brush area. On the other hand, if the carbon particles are homogeneous, small, and uniform, most carbon particles move with water unhindered by the fibers, such that a continuous and smooth intensity change appears across the diffusion area. This occurs because only sufficiently small carbon particles can seep into the fiber mesh and flow along with water particles, large carbon particles are left without flowing away.
Under the influence of the motion of water particles, suspended carbon particles move in a manner called Brownian motion [21]. According to this physical mechanism, the quantity of carbon flow is proportional to the quantity of water flow. A phenomenon occurs because only
those carbon particles whose granule size is smaller than the space between fibers can seep into the mesh along with water. Particles whose granule size is bigger than the space remain at the initial position, as shown in Figure 4.8. This phenomenon is referred as a “filtering effect”
[11, 16] of the fiber mesh, and can be represented as the following, where p is the papel the carbon particle lays in and Hole_Diameter is defined as the average length of diameter of the holes between fibers in the papel.
if ( Carbon_Diameter > Hole_Diameter(p)) then Carbon_Position Å p
else
Carbon_Position Å Water_OutFlow_Direction(p),
(a)
(b) Two adjacent cubes represent two neighbor papels. Black grains in papels are carbon particles in different sizes. The chaos strings on the face between two papels represent fibers. The arrow represents the direction of water flow which carbon particles are moving along with.
(c) Larger diameter of carbon particles can not pass the holes between fibers results in a filtering effect and be left in the original papel.
Figure 4.8 An illustration to explain the phenomenon called “filter effect” (Courtesy of Huang).
Besides the diameter-filtering mechanism, the mass-filtering mechanism is proposed.
Suppose is the velocity of the carbon c suspended in the water in papel p, and is the quantity of out-flowing water in p. The relationship between , and the diameter of
holes in p, Hole_Diameter(p), is described as
Vc Wp
If the carbon c is too heavy to moved out from papel p and then deposited in p, then . On account of this physical phenomenon [21], we define an upper-bounded eshold Tp for papel p, to decide whether the carbon particle can move out or not. If the mass of carbon c is larg than T 0
4.2.4 The Moving Direction of Water Flow
The water in a papel may flow to some of its eight neighboring papels. The directions of this movement are determined by taking the following dominant factors that affect the flow of water into account.
2. Degree of Absorbency for water of the neighboring papels.
3. Factor of paper texture of the neighboring papels.
4. Factor of inertia acting on water flow.
All of these factors are about the relationship between some papels and their neighboring papels. Therefore, we classify neighboring papels into eight directions, (k = 1, 2, …, 8), that point to the center of the neighboring eight papels (k = 1, 2, …, 8) from , respectively, as shown in Figure 4.9. By considering all the factors described above, we can obtain the probability of each direction and decide the quantity of the water flowing out according to these calculated probabilities, which will be shown in Equation 17.
dk
pk c0
Figure 4.9 Determine directions of water flowing into neighboring papels, (k =
Figure 4.9 Determine directions of water flowing into neighboring papels, (k =