CHAPTER 3 SYSTEM OVERVIEW
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 = 1, 2, …, 8), according to the probabilities in eight directions calculated based on four factors (Courtesy of Huang).
pk
Besides, the static friction can affect the flow of water also. Static friction is a resistance that prevents water from moving and originates from the interfacial tension between water particles and fibers in the given area, even the tension among water particles. It increases linearly when the water particles intend to flow until it reaches the maximum static friction.
Then water starts to flow and the static friction transfers to the dynamic friction, as shown in
Figure 4.10.
Figure 4.10 The relationship among static friction , maximum static friction , and dynamic friction . P is the external force, such as interfacial tensions. f is the friction changed corresponding to P (Courtesy of Huang).
fs
fms fd
In Huang’s [13] method, the critical threshold , which is defined as the minimum quantity of water in a papel
CTp
p corresponding to the maximum static friction, is calculated
using the degree of absorbency, ap, as
p s
p a
CT =γ , (9) where γs is a coefficient for converting the degree of absorbency into the quantity of water
corresponding to maximum static friction and is set experimentally. When the quantity of water in p is larger than CTp, water is free to flow out from p . Otherwise, water is left in
p .
If water particles are decided to flow out, we calculate the probability of the flowing direction. The following paragraph describes how to transfer the four factors that affect the
The Factor of Gradient
It is assumed that the movement of water particles in a paper obeys Brownian motion. A mixture of two sets of water particles, each has different number of water particles, will produce an irreversible diffusion process in which water particles transfering from the set with larger number to the other one with smaller one. This movement continues until the difference of particle’s numbers of two sets reach a value expressing the balance of forces acting on these two sets in tolerance. Gradient here is used to represent the difference of number of water particles between two sets.
Let us assume that the number of water particles in and are and , respectively. The probability based on Brownian motion is determined by the equation
c0 pk Wc Wk
When the water particles intend to flow out into the neighboring papels, attractions from each neighboring papels result in different kinds of quantity of water flow. When the water
particles intend to flow, the static friction continuously acts on them and grows linearly until the maximum static friction is reached, as shown in Figure 4.10. Based on Newton’s Second Law Of Motions, we figure out the equation as
fs
fms
a M
fd = × , (11)
where is the dynamic friction, which cannot be changed by any forces or interfacial tensions, is usually a constant force in ideal between the flowing water and fibers. is the acceleration of those flowing water particles in water flow. Based on the theorem discussed by Theo [21], we figure out that is usually much smaller than , the acceleration of gravity.
Therefore, we can regard it as a constant value of acceleration acting on those water particles.
fd
a
a g
M is the mass of the flowing water. Because of the pre-defined uniformity of mass of water
particle, the quantity of water flow is proportional to M . Assume is the number of water particles in the water flow, the relationship between
Nw
M and Nw can be described as
M
Nw ∝ . (12)
From Equation 11 and 12, we can conclude that
a N
fd ∝ w× . (13)
According to the equations deduced above and the constant , the relationship between and is represented as
a fd
Nw
w
d N
f ∝ . (14)
This important deduction indicates that larger makes larger . Based on the relationship in Equation 8, we conclude that
fd Nw
respectively. Probabilities based on absorbency are distributed to the eight directions and calculated by the equations
The Factor of Paper Texture
While water pulled by capillarity and flowing in the holes of fibers, fibers in the trajectory of water flow are saturated with water. For this phenomena of capillarity, different
kinds of alignment of fibers result in different trajectories of water flow. The texture of Hsuan paper was, as a rule, solid, firm, unblemished, white and most hospitable to ink. After material choosing, steaming, bleaching, stamping, and baking, the paper was made with dense, fixed, irregularly distributed, and interlocked fibers of the material we use. According to those processes of manufacturing, the alignments of fibers in the paper structure are chaotic. In other words, the distribution of fibers in paper structure is uniform. When water in a certain papel determines the next papels to flow in, the probabilities of its eight candidate neighbors are almost the same for uniform distribution of fibers in paper mesh based on the factor of paper texture.
The second kind of representative paper usually used in ink painting is silk paper.
Because of the drawback of difficult preservation, the ancients discovered that silk paper is a good substitute for Hsuan paper. Besides the convenience of preservation, it has good ability of absorbency the same as Hsuan paper. Silk paper is handmade and woven in perpendicular directions. The special process of manufacture differing from the Hsuan paper results in different kinds of distribution of fibers. For the reason, the directions of water flow are mainly vertical or horizontal when the water flowing in the holes of fibers in a piece of silk paper.
Huang [13] took the texture of paper into account as a factor determining the directions of water flow. Since the distributions of fibers in paper structure are not the same, the textures
of paper are different. When the water particles in a papel decided to flow out, we cover with a texture mask, denoted as , with the center element positioned at . The eight elements in periphery of , denoted as (k = 1, 2, …, 8), are weights
used to represent the alignment of fibers of different kinds of papers. For a simple instance, we use two kinds of to represent the texture of Hsuan paper and silk paper, as shown in Figure 4.11.
c0
c0 3×3 Mdirect m0
c0 Mdirect mk
direct
M
In Figure 4.11(b), all of the elements in periphery set to 1 express that all the eight probabilities of flowing direction of neighboring papels are equal because of random, uniform distribution of fibers. Elements in horizontal and vertical directions given larger value than those in diagonal direction, as shown in Figure 4.11(c), expresses the regular distribution of fibers in silk paper.
Figure 4.11 (a) Texture mask; (b) One example of texture mask for Hsuan paper;
(c) One example of texture mask for silk paper. is the center element in the mask positioned at (Courtesy of Huang).
m0
c0
The Factor of Inertia
Besides those three factors we have mentioned above, there is still an important physical mechanism we need to take into consider. Every moving object without actively motive
Besides those three factors we have mentioned above, there is still an important physical mechanism we need to take into consider. Every moving object without actively motive