KeyWords

1 Introduction

In computer graphics, most of the researches on the simulation of painting effects have focused on western paintings, including watercolor, pencil sketching, and hatching (Small 1991; Curtis et al. 1997). Most of the methods work well for the western arts; however, they cannot be directly applied to the Chinese ink painting and Calligraphy, due to the special characteristics of Chinese writing tools, which are Chinese brush, ink, and Xuan paper. In this chapter, we mainly focused on the ink model and paper model, which together produce the ink diffusion effect.

Guo and Kunii (1991) proposed the first model for the simulation of ink diffusion in Chinese Calligraphy. They assumed that the ink consisted of pigment particles of different sizes, and the ink spreads as a one-dimensional filtering process. Later, a multidimensional diffusion model (Kunii et al. 1995) was proposed, in which the ink diffusion on paper was considered as a two steps procedure: the flow of water on the paper and the motion of the ink particles. This model could simulate precisely the real physical phenomenon, but it required high computational cost for rendering complex strokes; thus it cannot be used for real-time rendering. Kunii et al. (2001) used a partial different equation (PDE) in attempt to better describe the phenomenon, which was essentially Fick’s law of diffusion. However, this PDE could only produce blurry strokes instead of the realistic fluid-like patterns. Guo and Kunii (2003) proposed a new algorithm to improve the computational efficiency (Kunii et al. 1995, 2001), by processing only the fronts of the spreading strokes, but this also limited the range of producible effects. Later, a “Pseudo-Brown movement” model (Shi et al. 2003) was used to simulate the impetus of water upon the ink particles, which required high computational cost. The properties of the paper also play a crucial part in the effects of ink diffusion, so some researchers designed different models for the paper (Lee 1999, 2001; Chu and Tai 2005). Lee proposed the paper models of various types to obtain different diffusing results. Laerhoven et al. (2004) described the implementation of a paper model that allowed for real-time creation of watercolor images by simulating the mechanics of pigment and water throughout a three-layer paper. Chu and Tai (2005) proposed a three-layer paper model and used different textures to represent the physical parameters of the paper.

The aforementioned methods mainly focus on the visually plausible diffusion effects, instead of physically accurate results. To obtain physically convincing ink diffusion patterns, methods from Computational Fluid Dynamics (CFD) have been exploited. Chu and Tai (2005) adopted the Lattice Boltzmann Equation (LBE) method (He and Luo 1997; Dardis and Mccloskey 1998; Chen et al. 1998; Wei et al. 2004; Chu 2007; Begum and Basit 2008), which models the dynamics of fluid at the particle level.

The main contribution of this research is that a new ink diffusion model based on fluid dynamics has been proposed, and a new and simple three-layer paper model has been designed to simulate the properties of the paper, and together they can produce physically accurate results in real-time. In order to create the blurry of brushstroke boundary, a new multi-concentration ink model is proposed, which can create different blurry effects according to paper.

We present some background on Eastern ink painting and writing in Sect. 2 and describe the Navier–Stokes Equation (NSE) and Lattice Boltzmann Method (LBM) (Succi 2001) in Sect. 3. In Sects. 4 and 5, we present the three-layer paper model and multiconcentration ink model, respectively. Rendering results and conclusions are given in Sect. 6.

2 Physical Properties of Ink Painting

Chinese ink, known as “mo” in Chinese and “sumi” in Japanese, refers to a kind of paint used ubiquitously in the traditional East Asian painting and Calligraphy. Artists use a flexible brush to create expressive lines, shapes, and exploit the interplay of ink and water to produce shades and patterns with spontaneous styles. In order to simulate the diffusion of ink, it’s crucial to first explore the physical properties of the ink and the paper during the painting process. In this section, we discuss the properties of the ink and the paper, and the artistic effects related to ink diffusion.

2.1 Physical Characteristics of Chinese Ink and Paper

In general, Chinese ink is composed of glue, soot, and water. The soot is composed of 10–150 nm carbon particles and dissolves readily in water, and those primary particles combine to form relatively bigger clusters (100–300 nm), which represent the physical unit of soot (Swider et al. 2003). When a drop of ink falls on the surface of the absorbent paper, the water begins to spread along the fibers of the paper under the capillary force stemmed from the small spaces in-between the fibers. Some of the ink particles moves with the flowing water, and some remain where they were at the first place. When ink dries, the solid form of Chinese ink is a mixture of carbon particles and glue.

Typical paper consists of fibers organized in random positions and directions: small spaces among the fibers act as small capillary tubes, which can absorb the water and distribute the water to the surrounding places; thus, it produces the effects of diffusion. According to the different diffusion patterns, the Xuan paper can be categorized into three types: untreated Xuan, half-treated Xuan, and treated Xuan. The untreated Xuan is the main medium used in Chinese painting and Calligraphy since it absorbs water easily; treated Xuan paper refers to the Xuan Paper after special treatment with vitriol and gum, and it has the characteristics of no seeping; and the half-treated Xuan’s absorptivity is between the above two. In this work, we mainly simulate the diffusion effects on the absorbent Xuan paper.

2.2 Effects of Ink Dispersion

When a brush touches the paper, ink is transferred from the brush onto the paper. Slowly, flowing with the water, carbon particles sink down into the paper and flow along the fibers by the capillary force. Eventually, the water evaporates, leaving the carbon particles fixed on the paper, and the diffusion effects appear. As a result of the dispersing process, the final strokes appear to be bigger than the initial shape.

A remarkable feature of the diffusion effect is a kind of shadow band along the edge of the initial zone, one example is shown in Fig. 1. The complex characteristics of diffusion have a close relationship with the physical interactions between the ink and the paper, which cannot be accurately simulated by conventional graphical functions such as textures, which just produce visually blurred images instead of realistic random diffusion effects. So, the key points of the simulation are how to simulate the flow dynamics of the ink, the spreading and sinking movements of the pigments, and the evaporation of water.

Fig. 1
figure 1

Diffusion of a drop of ink

By observation of the real ink diffusing effects (Fig. 1), we can imagine that there is a filter, through which only the carbon particles of the size smaller than the space in-between the fibers can pass; and the larger ones are blocked and remain as they were, as shown in Fig. 2. This is called the filtering effect. The area in the red circle denotes the filter surface, and the green one is the initial area where the brush first touches the paper. We implement this filtering effect on the second layer of the three-layer paper model—the flow layer, which is detailed in Sect. 4.1. The size and the density of the particles can be described as the concentration of the carbon particles, which is discussed in Sect. 5.2.

Fig. 2
figure 2

The filtering effect

3 Computational Fluid Dynamics

The ink is a kind of colloidal liquid with the viscosity factor and ink diffusion phenomenon can be considered as a typical instance of the diffusion of a colloidal liquid in 2D. The capillary force causes ink to diffuse in the inner structures of the paper. So, it’s physically and practically to use CFD to imitate the flow of ink. We describe the basic NSE and LBM (He and Luo 1997; Shen et al. 1998; Yu et al. 2003) to solve this equation, which is one of the promising methods to solve the NSE.

3.1 The Navier–Stokes Equations

The Navier–Strokes equations (Stam 1999) is obtained by imposing the constraints that the fluids conserve both the mass and the momentum. Although factors such as temperature and density may influence the flow, we only use two parameters to describe the flow, a velocity field u and a pressure field p, which are functions of both time and spatial positions. Here, we denote the fluid as \( x,u \) both at two dimensions \( \left\{ {x,y} \right\}. \) Given the velocity and the pressure at the initial time\( t = 0, \) the evolution of these quantities over time is given by NSE.

$$ \nabla \cdot u = 0 $$
(1)
$$ \frac{\partial u}{\partial t} = - \left( {u \cdot \nabla } \right) - \frac{1}{\rho }\nabla p + \nu \nabla^{2} u + f $$
(2)

where \( \nabla = (\partial /\partial x,\partial /\partial y), \) “·” denotes the dot product, and the shorthand notation \( \nabla^{2} = \nabla \cdot \nabla ;\nu \) and \( \rho \) are the kinematic viscosity and the density of the fluid respectively, and f is the external force.

The pressure and the velocity fields in the NSE are related. A single equation for the velocity can be obtained by combining Eqs. (1) and (2). The Helmholtz–Hodge Decomposition can be used that any vector field w can uniquely be decomposed into the following form:

$$ w = u + \nabla q $$
(3)

where u has zero divergence: \( \nabla \cdot u = 0 \) and q are a scalar field. Any vector field is the sum of a mass conserving field and a gradient field. This result can define an operator P which projects any vector field w onto its divergence free part \( u = Pw. \) The operator is in fact defined implicitly by multiplying both sides of Eq. (3) by “∇”:

$$ \nabla \cdot w = \nabla^{2} q $$
(4)

This is a Poisson equation for the scalar field q with the Neumann boundary condition for the scalar field q with boundary condition \( \partial q/\partial n = 0 \). A solution of this equation is used to compute the projection u:

$$ u = Pw = w - \nabla q $$
(5)

If we apply this projection operator on both sides of Eq. (2), we obtain a single equation for the velocity:

$$ \frac{\partial u}{\partial t} = P\left( { - \left( {u \cdot \nabla } \right)u + \nu \nabla^{2} u + f} \right) $$
(6)

where \( Pu = u \) and \( P\nabla p = 0 \). This is the fundamental equation from which we will develop a stable fluid solver.

3.2 Method of Solution

Because the NSE is hard to solve, various methods have been proposed. The traditional methods (Chorin 1968) solve for the macroscopic variables, such as velocity and density, which is complex. Unlike the traditional ones, the Lattice Boltzmann Method (LBM) is based on the microscopic kinetic equation for the particle distribution function. The LBM has become an attractive method to the conventional computational fluid dynamics method for solving NSE. Because we are going to use to simulate the ink diffusion, we would like to introduce a standard square lattice model for 2D flow called D2Q9, as shown in Fig. 3, which are just like ink diffusion on paper. The physical space is divided into a regular lattice and the velocity space is discretized into a finite set of velocities \( c_{\alpha } , \) the Boltzmann equation can be discretized as

Fig. 3
figure 3

D2Q9

$$ f_{\alpha } \left( {x_{i} + c_{\alpha } \Updelta t,t + \Updelta t} \right) = \left( {1 - \frac{1}{\tau }} \right)f_{\alpha } \left( {x_{i} ,t} \right) + \frac{1}{\tau }\left( {f_{\alpha }^{\text{eq}} \left( {x_{i} ,t} \right)} \right) $$
(7)

where \( \Updelta t \) and \( c_{\alpha } \Updelta t \) are time step and space increments, respectively, \( f_{\alpha } \) is the single-particle velocity distribution function along the \( \alpha _{\text{th}} \) direction; \( f_{\alpha }^{\text{eq}} \) is the equilibrium distribution function, and \( \tau \) the single relaxation time.

There are different types of lattice for LBM. For simplicity and without loss of generality, we consider the two-dimensional square lattice with nine velocities as shown in Fig. 3, the D2Q9 model:

$$ c_{\alpha } = ce_{\alpha } = \left\{ {\begin{array}{*{20}c} {\left( {0,0} \right)} \hfill & {\alpha = 0,} \hfill \\ {c\left[ {\cos \left( {\frac{\alpha - 1}{2}\pi } \right),\sin \left( {\frac{\alpha - 1}{2}\pi } \right)} \right]} \hfill & {\alpha = 1,2,3,4} \hfill \\ {\sqrt 2 c\left[ {\cos \left( {\frac{\alpha - 5}{2}\pi + \frac{\pi }{4}} \right),\sin \left( {\frac{\alpha - 5}{2}\pi + \frac{\pi }{4}} \right)} \right]} \hfill & {\alpha = 5,6,7,8} \hfill \\ \end{array} } \right. $$
(8)

Here, we set c = 1, \( \rho = 1 \). For thermal fluids, the equilibrium distribution function for D2Q9 model is given by

$$ f_{\alpha }^{\text{eq}} = \rho w_{\alpha } \left[ {1 + \frac{3}{{c^{2} }}c_{\alpha } \times u + \frac{9}{{2c^{4} }}\left( {c_{\alpha } \times u} \right)^{2} - \frac{3}{{2c^{2} }}u \times u} \right] $$
(9)

where \( w_{o} = \frac{4}{9}, w_{1} = w_{2} = w_{3} = w_{4} = \frac{1}{9}, \) and \( w_{5} = w_{6} = w_{7} = w_{8} = \frac{1}{36}. \) The macroscopic density \( \rho \) and velocity \( u \) are related to the distribution function by using the Chapman-Enskog expansion; Eq. (7) can recover the NSE to the second order of accuracy, with the kinematic viscosity given by

$$ \rho = \sum\limits_{\alpha = 0}^{8} {f_{\alpha } } \quad {\text{and}}\quad \rho u = \sum\limits_{\alpha = 0}^{8} {f_{\alpha } c_{\alpha } } $$
(10)
$$ v = \frac{{\left( {\tau - 0.5} \right){\text{c}}^{2} \Updelta t}}{3} $$
(11)

In the standard LBM, Eq. (7) has a two-step process: the streaming step and the collision step, as follows:

  1. (1)

    Streaming step:

    $$ f_{\alpha } \left( {x_{i} + c_{\alpha } \Updelta t,t + \Updelta t} \right) = \widetilde{f}_{\alpha } (x_{i} ,t) $$
    (12)
  2. (2)

    Collision step:

    $$ \widetilde{f}_{\alpha } \left( {x_{i} ,t} \right) = f_{\alpha } \left( {x_{i} ,t} \right) - \frac{{f_{\alpha } \left( {x_{I} ,t} \right) - f_{\alpha }^{\text{eq}} (x_{i} ,t)}}{\tau } $$
    (13)

4 Three-Layer Paper Model

The movement of the ink in the paper is determined by the fluid dynamics and the interactions between the ink and the paper as well. Here, we adopt the LBM to simulate the ink movement. However, unlike the fluid dynamics simulation, the ink should stop dispersing after the water is absorbed by the paper and finally evaporate. Therefore, in order to effectively control the flow range of the ink fluid, a three-layer paper model similar to (Laerhoven et al. 2004; Chu and Tai 2005) is used. In this section, we will talk about the three-layer paper model, the transfer of ink, the pigment fixture, and the ink evaporation.

4.1 Paper Model

The three-layer paper model consists of a surface layer, a flow layer and a fixture layer, as shown in Fig. 4. The top surface layer acts like a receiver and a container, which receives the ink from the brush and conserves the ink; the middle flow layer only gets water from the surface layer, which is responsible for ink flowing along the fibers of the paper; with the ink flowing, the smaller ink particles sink down into the bottom fixture layer, and finally it shows the result of diffusion. In this section, we will discuss the transitions of the ink through each of the three layers.

Fig. 4
figure 4

Three-layer paper model

4.2 Transfer of Ink in Surface Layer

In our real painting process, the amount of ink deposited on paper has a close relationship with the results. The amount of ink deposited onto the surface is determined by the amount of ink contained in the brush hand, the size of brush footprint on paper surface. Ink is supplied from the surface layer to the flow layer according to the capacity of the paper fibers. The surface layer stores excess ink not yet absorbed by the flow layer.

To model the capacity of the paper, to model the different water, the amount of water supplied to flow layer is clamp (\( s,0,\pi - \rho \)), where \( \rho \) represents the density of water in the pixel in the flow layer, which could be calculated from Eq. (10), \( \pi \) represents the capacity of the paper fiber and clamp (s, min, max) returns the clamped value of s against the limits of min and max. What’s more, each pixel in the footprint is masked by the value \( \hbox{max} \,\left( {1 - \frac{\rho }{\pi },m} \right), \) where m is base mask value, for example, the paper texture (Chu and Tai 2005).

When ink drops on the surface, the first layer is like a reservoir. We represent the ink concentration on the surface layer as \( p_{s} \). At the same time, clamp (\( s,0,\pi - \rho \)) amount of ink sinks down into the flow layer, whose main task is to simulate the capillary attraction in the paper. So, the concentration of ink in the flow layer is \( \frac{{p_{f} \cdot \rho + p_{s} \cdot {\text{clamp}}\,\left( {s,0,\pi - \rho } \right) }}{{\rho + {\text{clamp}}\,\left( {s,0,\pi - \rho } \right)}}. \) According to the parameters: \( p_{f} , p_{s} \) denote the concentration of ink in the flow layer and in the surface layer at the last frame, respectively.

4.3 Fixture of the Ink in Fixture Layer

The final results are represented on the third layer. To model the pigment in the third layer realistically, three rules are designed: (1) the transfer rate, the percentage of ink fixed on the third layer compared to the total amount in the same position, is higher when the glue is more concentrated; (2) the transfer rate is higher as the strokes become drier; (3) all the carbon particles are settled when a stroke dries.

We devise a simple pigment fixture algorithm that satisfies the above rules. \( \rho^{\prime} \), the water density (amount) in the flow layer in the last frame; \( \mu , \xi , \) denote parameters for modulating the fixture rate by dryness and glue, respectively. According to other parameters, g is the glue concentration in the flow layer; and \( \eta \) is the base fixture rate.

In Algorithm 1, rows 2–4 assure that if the stroke becomes drier, that is, loss >0, then fix factor is higher. The row 5 makes sure that the temp is in the range 0–1, while, the temp is increasing with \( \mu , \xi . \) In row 6, in order to produce boundary roughening and the color is darker than paper, we adopt the smoothstep function and max function, separately. Rows 7 and 8 update the data in the surface and flow layer respectively.

4.4 Water Evaporation from Flow Layer

In real writing process, when water evaporates from the paper, the pigment is left and the stroke appears. Every time evaporation happens, the pigment in the fixture darkens. So, in our imitating, evaporation is essential and important. We model this by having different evaporation rates for the boundary sites and the rest of the wet sites because of the different contact area rate of water. We do this by reducing the water density \( \rho \) at a rate of evaporation_rate as we update the \( \rho \) using Eq. (9), while it will increase the pigment in the fixture layer. This process is similar in (Chu and Tai 2005), except that we do not reduce those \( f_{i}^{\prime } \) that bounce back during streaming step.

In Algorithm 2, rows 2 and 3 obtain the evaporation rate. Rows 4 and 5 update the data in the fixture layer and flow layer respectively.

5 Multiconcentration Ink Model

In the real calligraphy, the boundary of a brushstroke is less darker than the initial part and the pigment isn’t changing sharply, which calls the blur effect. With the traditional single ink model, the pigment of the diffused image change sharply, which could not create the blurry effect, shown in Fig. 5a. In order to simulate the ink physically and simply, we devise a new ink model for this system.

Fig. 5
figure 5

Generated images with diffused ink drop. a With this new multiconcentration ink model and b with the single concentration ink model

5.1 Ink Model

Although the real ink in the same brushstroke is with the single concentration and the same quantity, in this new ink model, we assume that the ink of a brushstroke is with different concentration and different quantity. Generally speaking, when a new brushstroke is generated, the surface layer gets concentration and quantity of ink from the brush, the middle part of the brushstroke have a higher concentration and more ink than the boundary parts. In Fig. 6, it shows the distribution of ink in the surface layer, in which the black part with more ink and has a higher concentration.

Fig. 6
figure 6

The ink distribution in the surface layer

What’s more, the diffusion effect is connected directly to the paper’s absorbability, the wetness of the brush, the viscosity and concentration of ink. We will adopt a new algorithm to preprocess the ink on the surface layer.

5.2 Different Ink Concentrations

The blurry effect has something to the paper absorptivity, the viscosity and concentration of ink. In this paper, we use the viscosity, \( v \), which we could get from Eq. (10). From observations and researches, the higher the paper absorptivity is, the blurry effect can be more obvious. While the higher the ink viscosity is, the blurry effect can be less obvious. In this research, we ignore the absorptivity and only take the viscosity into account. We devise an algorithm to process ink before diffusion begins.

In Algorithm 3, row 2 makes sure that the whole algorithm processes the data on the boundary. Rows 4 and 5 assure that the temp is related to the absorptivity to the paper. Rows 5–12 renew the concentration and quantity of ink in the boundary in the surface layer.

In Fig. 7, the images show the different diffusion effect due to the viscosity. (a) diffused with the traditional single ink model; from (b)–(d), the images all diffused with the multiconcentration ink model, while the viscosity is increasing.

Fig. 7
figure 7

Images of a Chinese word of diffused ink. a With the traditional single concentration model and bd with the multiconcentration ink model while the viscosity is increasing

6 Results and Conclusion

6.1 Results

All the results are rendered on a desktop PC with a 3.07 GHz IntelCore i7 CPU with 4 GB of RAM CPU, which is equipped with a NVIDIA GeForce GTX 570 GPU with 1280 MB of dedicated video memory. The Wacom Cintiq 21UX Pen Display device is used to obtain the information of the pressure and the positions during the drawing interaction, and used as the display monitor as well.

We have designed an interaction system for the purpose of Chinese Calligraphy education, and focus on the simulation of ink diffusion effect, which is essential for showing the vivid brushstrokes of Chinese Calligraphy. The rendering results are computed in real-time as a resolution of 512 × 512, showing the differences between the results without and with ink diffusion effect; and more results are shown in Figs. 8, 9, and 10.

Fig. 8
figure 8

Rabbits a without ink diffusion and without pressure, b diffusion with the single concentration ink model, and c diffusion with the multiconcentration ink model

Fig. 9
figure 9

Turtles a diffusion with the traditional single ink model and b diffusion with multiconcentration ink model

Fig. 10
figure 10

a Simple Chinese landscape Painting, b tree, and c sports

6.2 Contribution

In this chapter, a novel approach is presented for simulating ink diffusion on paper. First, the flow of the ink is realized based on the fluid dynamics, and the Lattice Boltzmann method is used to solve the Navier–Stokes equations; therefore, it can produce physically realistic diffusing results. Second, a three-layer paper model has been designed to control the flow. The surface layer is responsible for receiving ink from brush; the ink only flows in the flow layer; as the ink evaporates from the flow layer, the carbon particles gather in the fixture layer. Thirdly, in order to produce blurry effects, a multiconcentration ink model, which is based on the ink viscosity and paper absorptivity, is devised to control the blurry results. Finally, a Chinese Calligraphy system is implemented based on the above models, which produce vivid strokes in real-time.

Besides ink diffusion, the Chinese brush also plays an important role in the artistic effects of the Chinese Calligraphy. So our future work is to design a more accurate physically based model for the brush, which can produce more complicated, vivid, and realistic strokes.