Image Based Simulation for Pyrography Style Painting · Image Based Simulation for Pyrography Style...

6
Image Based Simulation for Pyrography Style Painting Dong WANG, Jionghui JIANG, Shisheng ZHOU Image Based Simulation for Pyrography Style Painting Dong WANG * 1,2, Corresponding author ,Jionghui JIANG 2 ,Shisheng ZHOU 1 *1 Xi’an University of Technology, Xi’an 710048, Shaanxi, China Faculty of Printing and Packaging Engineering, *2, Corresponding author HangZhou 310024, Zhejiang, China Zhijiang College, Zhejiang University of Technology, [email protected], [email protected], [email protected] doi: 10.4156/jdcta.vol4.issue1.11 Abstract A technique for pyrography characteristic Simulation based on digital image is proposed. Firstly, a fast color characteristics transfer method based on local vector matching is used according to the similar feature of local region of image. Then, the color space is converted from RGB to Ruderman et al.’s perception-based color space lαβ, according to a certain standard, feature vector is obtained from the mean values and standard deviation of local region of source image, and also, a sample matching is performed between the target and the source image according the local vector characteristics. Therefore, the Welsh’s point-to-point matching algorithm is avoided. On the basis of color transfer, the result image is integrated with the texture image, through adjusting the Alpha information; the china traditional folk pyrography painting effect is obtained. The experimental results show that the color transfer algorithm has the some advantages, such as high precision, strong universality and faster computation speed; and the final pyrography effects are satisfying. Keywords color transfer, lαβ , pyrography, simulation, vector matching. 1. Introduction With the development of computer technology, non-photorealistic rendering (NPR) has become one of the hotspots in the research of computer graphics in recent years. More and more attention has been paid in this field. Comparing with traditional methods, NPR highlights the reproduction of the artist's drawing style. The interest lies not only in the physical properties of natural images, but also focuses on the image personalization and artistic expression. Pyrography is the art of decorating wood or other materials with burn marks resulting from the controlled application of a heated object such as a poker. It is also known as pokerwork or wood burning. Pyrography means “writing with fire” ,also called “fire needle embroidery” in ancient China, “iron painting”or “burnt picture”in the Chinese folks art in modern.It is the traditional art of using a heated tip to burn or scorch designs onto natural materials such as wood or leather,and also is the most precious resources of painting styles in china. It has a long history and is one of the mass' favorite folk art. Generally, the dried hard- shell gourd and wood furniture serve as the carrier for Pyrography in the northeastern part of China in the early 1960’s. Later, the carrier has been extended to many other materials, such as bark, paper, cloth and woolen blanket. Because of the specialties of “painting” tools and materials, Pyrography has its own characteristics, and a 3D embossment effects can be formed on the surface of carrier. The color is puce, light brown and even black. A snapshot of the wood burning Pyrography is showed in Fig. 1. The pokerwork is time-consuming, done entirely by hand, with each line of a complex design drawn individually. Based on the characteristics of the Pyrography, we make a try of Pyrography reproduce with computer. Computer-aided Pyrographys can be widely used in decorative graphic design, e-cards, advertising and games, animation and other fields. Figure 1. A snapshot of the Chinese wood burning pyrography 2. Related Work 106

Transcript of Image Based Simulation for Pyrography Style Painting · Image Based Simulation for Pyrography Style...

Page 1: Image Based Simulation for Pyrography Style Painting · Image Based Simulation for Pyrography Style Painting Dong WANG, Jionghui JIANG, Shisheng ZHOU Image Based Simulation for Pyrography

Image Based Simulation for Pyrography Style Painting Dong WANG, Jionghui JIANG, Shisheng ZHOU

Image Based Simulation for Pyrography Style Painting

Dong WANG* 1,2, Corresponding author,Jionghui JIANG 2,Shisheng ZHOU 1 *1

Xi’an University of Technology, Xi’an 710048, Shaanxi, China Faculty of Printing and Packaging Engineering,

*2, Corresponding author

HangZhou 310024, Zhejiang, China Zhijiang College, Zhejiang University of Technology,

[email protected], [email protected], [email protected] doi: 10.4156/jdcta.vol4.issue1.11

Abstract

A technique for pyrography characteristic

Simulation based on digital image is proposed. Firstly, a fast color characteristics transfer method based on local vector matching is used according to the similar feature of local region of image. Then, the color space is converted from RGB to Ruderman et al.’s perception-based color space lαβ, according to a certain standard, feature vector is obtained from the mean values and standard deviation of local region of source image, and also, a sample matching is performed between the target and the source image according the local vector characteristics. Therefore, the Welsh’s point-to-point matching algorithm is avoided. On the basis of color transfer, the result image is integrated with the texture image, through adjusting the Alpha information; the china traditional folk pyrography painting effect is obtained. The experimental results show that the color transfer algorithm has the some advantages, such as high precision, strong universality and faster computation speed; and the final pyrography effects are satisfying.

Keywords

color transfer, lαβ , pyrography, simulation, vector

matching.

1. Introduction

With the development of computer technology, non-photorealistic rendering (NPR) has become one of the hotspots in the research of computer graphics in recent years. More and more attention has been paid in this field. Comparing with traditional methods, NPR highlights the reproduction of the artist's drawing style. The interest lies not only in the physical properties of natural images, but also focuses on the image personalization and artistic expression. Pyrography is the art of decorating wood or other materials with burn marks resulting from the controlled application of a

heated object such as a poker. It is also known as pokerwork or wood burning. Pyrography means “writing with fire” ,also called “fire needle embroidery” in ancient China, “iron painting”or “burnt picture”in the Chinese folks art in modern.It is the traditional art of using a heated tip to burn or scorch designs onto natural materials such as wood or leather,and also is the most precious resources of painting styles in china. It has a long history and is one of the mass' favorite folk art. Generally, the dried hard-shell gourd and wood furniture serve as the carrier for Pyrography in the northeastern part of China in the early 1960’s. Later, the carrier has been extended to many other materials, such as bark, paper, cloth and woolen blanket. Because of the specialties of “painting” tools and materials, Pyrography has its own characteristics, and a 3D embossment effects can be formed on the surface of carrier. The color is puce, light brown and even black. A snapshot of the wood burning Pyrography is showed in Fig. 1. The pokerwork is time-consuming, done entirely by hand, with each line of a complex design drawn individually. Based on the characteristics of the Pyrography, we make a try of Pyrography reproduce with computer. Computer-aided Pyrographys can be widely used in decorative graphic design, e-cards, advertising and games, animation and other fields.

Figure 1. A snapshot of the Chinese wood burning

pyrography

2. Related Work

106

Page 2: Image Based Simulation for Pyrography Style Painting · Image Based Simulation for Pyrography Style Painting Dong WANG, Jionghui JIANG, Shisheng ZHOU Image Based Simulation for Pyrography

International Journal of Digital Content Technology and its Applications Volume 4, Number 1, February 2010

Image-based NPR can be divided into two groups: the first group is the artistic style images generated automatically by computer, which includes color and texture transfer based on artistic styles. The other one is based on the physical simulation of process, which produce an artistic effect through a specific brush stroke model. Learning of image rendering style based on texture synthesis is to transfer texture of a specific artistic style sample image to the target image in order to make target image keep a similar style with the sample image[1,2]. J. Curtis and Y.H.Chang obtained the various artistic effects of watercolor and Oil Painting in computer by use of setting painting brush [3,4]. Y.X Shi simulates the typical effects of Chinese ink wash drawing successfully through using “layer mixing arithmetic” to realize multi-stroke superposition[5]. J.H.YU demonstrate a Computer-Generated Gouache Rendering of 3D Polygonal Models, which employed brush unit design ,pigment simulation ,pigment diffusion and high level control mechanism to simulate the drawing of opaque watercolour painting[6,7]. Stroke-Based Rendering(SBR) is the core technology in these algorithms mentioned above. At present, there are many artistic styles generated from SBR technology, such as pen-and-ink style, sketch[8]

Tomihisa Welsh employed a general technique for “colorizing” grayscale images using color transfer between a source, color image and a destination, grayscale image in 2002

,stipple style, flow field visualization, tile mosaics, oil painting, watercolor and traditional Chinese paintings style, etc..

[9]

quite. Welsh algorithm is used

widely, but it has a slow operation speed, it cost a great deal of time to carry out the point-to-point matching calculation. Therefore, it is difficult for a large number of images to perform the bulk of color transfer. For example, in video applications, “colorizing” each image in a sequence is labor intensive, and even more work is necessary to produce a sequence that is temporally coherent. Obviously, it would be difficult to achieve.

In fact, the neighborhood pixels between homogeneous images have some similar properties, i.e. pixels are characterized only by luminance. The standard deviation of the luminance and the mean values in a pixel neighborhood are almost the same. Therefore, a new color transfer algorithm using a suitable structure of vector group and then calculating the L2 distance by sampling according to a certain standard is presented in this paper. As a more refined searching strategy, the new vector matching method can reduce the costs of the search process for matching pixels, and the overall computation time needed to perform a full-search sampling strategy can be avoided.

In this paper, our goal is to reproduce the Pyrography style paintings. So the first step is the color

transfer between images, the second step is image fusion. 3. Color transfer based on vector matching 3.1 lαβ Color Space converting and Data Correction

RGB color space is a three-dimensional linear space, which implies that if we want to change the appearance of a pixel’s color in a coherent way, the color modification process is complicated, and it is not suited for color transfer. In 1998, Ruderman et al. developed a perception-based color space lαβ[10]

0.3811 0.5783 0.04020.1967 0.7244 0.07080.0241 0.1288 0.8444

l Rm Gs B

=

, which is based on data-driven that assumes the human visual system ideally fit to process natural scenes. The l axis represents the chromatic channel, and α and β axes are chromatic yellow–blue and red–green opponent channels. The axes of lαβ color space have little correlation comparing to the ones of RGB color space, therefore, we can make operation in different channels without affect values in the other channels. In this paper, we convert source and target images to lαβ color space, then calculate L channel separately. Because lαβ is a transform of LMS cone space, we can use to multiply the columns of matrix to yielding the RGB to LMS conversion:

(1)

But the data in LMS color space are dispersed, in order to make the data convergent, we can convert the data to logarithmic space. Using theory of principal components analysis (PCA),we can make statistical analysis for the image F(x,y) and G(x,y),respectively, then calculated immediately the convert matrix between the LMS and the lαβ, so an orthogonal matrix is obtained. Using this method we convert from RGB to lαβ. Here we eliminate the correlation relationship between each channel by

1 0 03 1 1 1

10 0 1 1 26

1 1 010 02

l LMS

αβ

= − −

(2)

The method of full-search sampling strategy is used to maintain the global color tone, and the method of local search for target is used to keep texture. The new lαβ value is based on the comparison of each pixel between the source and target image.

Also, in order to matching the target image we need to correct the luminance of source image, as follows[11]:

107

Page 3: Image Based Simulation for Pyrography Style Painting · Image Based Simulation for Pyrography Style Painting Dong WANG, Jionghui JIANG, Shisheng ZHOU Image Based Simulation for Pyrography

Image Based Simulation for Pyrography Style Painting Dong WANG, Jionghui JIANG, Shisheng ZHOU

( ( ) ) '( )G

C p mC mG C pC

σσ

− + → (3)

Where,C(p) is the pixel luminance of source image, mC and Cσ is the mean value and standard deviation of source image, respectively, mG and Gσ is the mean value and standard deviation of target image, respectively.

3.2 Local vector Calculation

Usually the luminance values between the neighborhood pixels in local region of an image are related, local vector calculation can put the statistical information of the source image, target image and its low-resolution images into consistency value. To perform the matching we divide the source image and the target image into some regions ( 'w ) according to a certain standard, and process the region 'w with vector calculation, which is shown in Figure 2.

Figure 2. Neighborhood with size of 5×5 pixels 'w

Because the local mean value and standard

deviation is a good indication for the details distribution of an image, we use them for the similarity calculation. The luminance values of the neighborhood of pixel “p” can be express as structure vector L(p):

( ) '( ), ( '( )), ( '( ))L p C p mea nC p std C p= (4) Where, '( )C p is the pixel luminance of target

image, ( '( ))mean C p and ( '( ))std C p is the mean value and standard deviation, respectively, which can be defined as:

'( )

2

'( )

1( '( )) ( )

1( '( )) ( ( ) ( ))

q C p

q C p

mean C p F qn

std C p F q mean pn

=

= −

(5)

After vector calculation of the local region 'w , the vector Matrix U which is made up of mean value and standard deviation is given by:

11 12 1

21 22 2

1 2

( ) ( ) ( )( ) ( ) ( )

( ) ( ) ( )

n

n

c c cn

U

L p L p L pL p L p L p

L p L p L p

=

3.3 Region characteristic matching and color transfer

According to local fuzzy calculation results, the local feature mean value and standard deviation of target image is served as the vector component of the pixel, the fuzzy vector set of the source image is sampled and the color information is extracted from swatch. Firstly, a maximum similarity set of source image and the target image is defined as:

:( ) ' ( ', ( ))cp w I d w w pΩ = ⊂ (6)

Where, )( pΩ is the set of target image sampling pixels, cI is the source image, 'w is the local region of the source image, p is the sampling pixel of target image ( gI ), ( )w p is the neighborhood region around pixel p.

Luminance l and fuzzy vector set are used to calculate the L2 distance, in order to measure texture and color similarity within the image, the L2

2( , ) [ '( ) ( )] ( '( ) ( ))c gp N p N

d N N C p G p C p G pσ σ∈ ∈

= − + −∑ ∑

distance is written as:

(7)

Where, ),( gc NNd is the distance between the

source image( cN ) and the target image( gN ), N is the local pixel set, 'C is the source image, G is the target image, 'Cσ is the standard deviation of the source image, Gσ is the standard deviation of the target image, p is the pixels within the local region. After comparing each point in the target image with the sampling region in the source image used distance formula, we can get the color region ( 'w ). The chromaticity values (α,β) are then transferred to the target image to form the final image. Finally, we transfer the result back to RGB from lαβ to display it. The inverse operations that convert from lαβ to LMS using this matrix multiplication:

33

66

22

0 01 1 11 1 1 0 01 2 0

0 0

l lms

αβ

= − −

(8)

(a) (b)

108

Page 4: Image Based Simulation for Pyrography Style Painting · Image Based Simulation for Pyrography Style Painting Dong WANG, Jionghui JIANG, Shisheng ZHOU Image Based Simulation for Pyrography

International Journal of Digital Content Technology and its Applications Volume 4, Number 1, February 2010

Then we convert the data from logarithm space to linearity space i.e. using 10lL = , 10mM = , 10sS = to replace the value of lms. Finally, we convert the data from LMS space to RGB space, as follows:

4.4679 3.5873 0.11931.2186 2.3809 0.16240.0497 0.2439 1.2045

R LG MB S

− = − − −

(9)

3.4 Experimental Results

This Section reports all the experimental results obtained with the proposed color transfer method and the performances are compared with Welsh work. We implemented our algorithm in MATLAB and VC++ platform, and all experiments were carried out on a PC dual PIV 2.4GHz, 512MB RAM, with Windows XP Operating System. In all cases the computation time of the Local vector matching was better than the classical full search. Running time comparison of several methods is listed in Table 1, from Table 1 we can find that the local vector matching can speeds up effectively the process .

Table1. Running time comparison (in seconds)

a1 a2 a3 a4 Welsh method

89.907 45.282 73.203 75.719

Our method 4.484 2.856 3.972 4.284 Speed-up times

22 15 24 18

The local vector matching process flow chart shown

in Figure3. Here, the source image is a color image; target image is a grayscale image. The Size of neighborhood pixel of the source and the target image is 5×5.

4. Pyrography Texture Fusion

We assume that target Pyrography image is ( , )S x y , and the background (for instance, the wood texture) image ( , )G x y can be seen as noncorrelation with zero mean images. Target Pyrography image ( , )S x y is the superposition of the above experimental results image ( , )F x y with wood texture image ( , )G x y .

( , ) ( , ) ( , )S x y F x y G x y= +

Figure 3. The calculation process of the local vector

matching. (a) is the color source image; (b) is the result image converted from RGB to lαβ ; (c) is the result image that the mean value for l channel; (d) is the

result image that the standard deviation for l channel; (e) is the target grayscale image; (f) is the result image

of the color transfer of the local vector matching.

Figure 4. Some examples of colored images obtained

with the Local vector matching. First column is the

(a3) 113×82 (b3) 113×82 (c3) 113×82 (d3) 113×82

(a4) 62×100 (b4) 54×10 (c4) 54×100 (d4) 54×100

(a) (b)

(c) (d)

(e) (f)

(a)Source image (b)Target image (c)Welsh result (d)Our result

(a2)100×97 (b2) 100×100 (c2) 100×100 (d2) 100×100

(a1)100×99 (b1) 100×87 (c1) 100×87 (d1) 100×87

109

Page 5: Image Based Simulation for Pyrography Style Painting · Image Based Simulation for Pyrography Style Painting Dong WANG, Jionghui JIANG, Shisheng ZHOU Image Based Simulation for Pyrography

Image Based Simulation for Pyrography Style Painting Dong WANG, Jionghui JIANG, Shisheng ZHOU

source image, second column is the target gray-scaled image, third column is the recolored image by Welsh algorithm, and last column is the result image through

our approach. Because the three-dimensional pixel values of RGB

color space image are from 0 to 255, if the image G(x, y) is superimposed directly onto the image F(x, y), the color gamut overflow will inevitably occurs. For solving this problem, the color space conversion and color channels decorrelation is employed. After converting ( , )F x y and ( , )G x y color space to lαβ , we superimpose the two source image, as follows:

'( , ) ( ( , )) ( ( , ))S x y l F x y l G x yαβ αβ= +

( ( , )) ( ( , ))( ( , )) ( ( , ))

l F x y RGB F x yl G x y RGB G x yαβ ψ

αβ ψ

=

=

Where, ψ is the transfer matrix for color space conversion. The experiment shows that it is very difficult for the algebra or logic operation to achieve Pyrography effects. When the two images overlay, the parts of the top image need to be transparent, otherwise, the two images will mutual interference. Therefore, we use the Alpha channel to solve the problem. However, most images there are no Alpha channels, such as 1, 4, 8 and 24bit images. So we must set appropriate Alpha values to reach the good effects. 32-bit images contain four channels , three 8-bit channels for red, green, and blue (RGB), in addition , there is 8-bit Alpha channel. The Alpha channel is specifies how the pixel's colors are merged with another pixel when the two are superimposed, one on top of the other. Also, the Alpha channel is used to describe the transparency of 256 different values, the greater Alpha values, the more opaque in the image. Because the Alpha channel automatically has the effects of gradient color, using Alpha information can not only generate transparency objects but also avoid the occurrence of jagged margin image.

In the computing process, two factors used in fusion calculation must be generated firstly, one is the source factor, which corresponds to the input image pixel data, and another is the target factor, which corresponds to the existing pixel data in the cache. When two image information fuses with each other, the input pixel will be combined with the corresponding pixels stored in the cache, we can get a new pixel values through the calculating information provided by the source factor and target factor. The final color can calculated by

1/255(Rs×SR+Rd×DR,Gs×SG+Gd×DG,Bs×SB+Bd×DB,AS×SA + Ad×DA

Where, (R

)

s,Gs,Bs,As) is the source factor, (Rd,Gd,Bd,Ad) is the target factor, AS is the transparency of the source image, Ad is the transparency of the target image. Setting (SR,SG,SB,SA) to be the pixel values of the source image,(DR,DG,DB,DA

In order to obtain the final effect of the fusion, the source factor must be multiplied by the factor of the source image as an input pixel values, then the target factor multiplied by target image pixel values, and finally image fusion is performed. Accordingly, normalization processing is required to maintain computation accuracy, if the values of pixel is greater than 255, it will be replaced by 255. By this way, we can keep the final image from overflow beyond gamut.

) is the pixel values of the target image in the same position.

In order to get better effects of wood pyrography, not all of the dynamic combinations of factors are appropriate; we must ensure that the color and wood texture matched exactly. At the same time, the board and the main part of the painting is opaque. The others of the painting are completely transparent. Therefore, the matching must satisfies the following conditions:

Based on the analysis above, some experiments

have been made by the use of painting and wood, the effects obtained is satisfying. Figure5 shows some experimental results.

5. Conclusions

We present a new method for creating an image

with a Pyrography appearance from two images, and a simple and very fast approach to the problem of partial image recoloring based on the work of Welsh et al. Imposing local vector matching and Alpha information onto the data points is a simple operation, which produces believable output images given suitable input images. Although this procedure is very simple and direct, the experimental results show that it works very well on a large set of images. We combined the color transfer with the image fusion and the Alpha

(Rd,Gd,Bd,Ad)

(255,255,255,255)

(255,255,255,255)- (AS,AS,AS,AS)

(Rs,Gs,Bs,As)

(255,255,255,255)

(255,255,255,255)- (Ad,Ad,Ad,Ad)

(255,255,255,255)- (AS,AS,AS,AS)

(255,255,255,255)- (Ad,Ad,Ad,Ad)

110

Page 6: Image Based Simulation for Pyrography Style Painting · Image Based Simulation for Pyrography Style Painting Dong WANG, Jionghui JIANG, Shisheng ZHOU Image Based Simulation for Pyrography

International Journal of Digital Content Technology and its Applications Volume 4, Number 1, February 2010

information, obtained the simulation of Chinese traditional folk Pyrography “painting” style ,which can holds the features of the original image, and can also be rendered in various saturation by Alpha adjusting and texture image changing. In the future, we wish to investigate Pyrography “painting” style animation. We’ll create a new animation form that couldn’t have existed without computers.

Figure 5. Some examples of Pyrography images

obtained with our method. First column is the source image obtained from color transfer’s result, second

column is the background image, and third column is the image fusion result, and last column is the

Experimental result: Pyrography simulation image.

6. References [1] X. G. Xu,et al. Artistic Style Learning. Journal of

Computer -Aided Design & Computer Graphics ,2002.14(9): pp. 866-869.

[2] W. H. XU,et al. Learning of Image Rendering Style Based On Texture Synthesis. Engineering Journal of Wuhan University,2003.26(3): pp. 11,119.

[3] Curtis C J,et al. Computer-Generated Watercolor. In: Computer Graphics Proceedings,Anua1Conference Series, ACM SIGGRAPH,Los Angeles California,1977. pp.421-429.

[4] Youngha Chang,et al.Example-Based Color Stylization of Images,ACM Transaction on Applied Perception,pp.322-345,2005.

[5] Yongxin,S,et al.Graphical Simulation Algorithm for Chinese Ink Wash Drawing by Particle System. Journal of Computer -Aided Design & Computer Graphics,2003.15(6),pp.667-672.

[6] Jinhui,Y,et al.Computer -Generated Gouache Rendering of 3D Polygonal Models(chinese). Journal of Computer-Aided Design & Computer Graphics,Vol .12,No .9,pp.565-766.

[7] Reinhard E,et al. Color transfer between images. IEEE Computer Graphics and Applications,vol. 21,no. 5,2001,pp.34-41

[8] M. Benjelloun,et al. Edge Closing of Synthetic and Real Images using Polynomial Fitting.Journal of Convergence Information Technology,Vol .2,No .4,pp.39-44.

[9] W. Tomihisa,A. Michael,Transferring Color to Greyscale Images. In: Computer Graphics Proceedings of SIGGRAPH,San Antonio,Texas,2002,pp. 277-280

[10] D.L. Ruderman,T.W. Cronin,C.C. Chiao. Statistics of Cone Responses to Natural Images: Implications for Visual Coding. J. Optical Soc. Of America,vol. 15,no. 8,1998,pp. 2036-2045.

[11] Hertzmann,A. ,et al. 2001. Image analogies. In Proceedings of the 28th Annual Conference on Computer Graphics and interactive Techniques SIGGRAPH 2001,August 2001. SIGGRAPH 01.

(a1) (b1) (c1)

(a2) (b2) (c2)

(a3) (b3) (c3)

(a4) (b4) (c4)

(a)Source image (b) Texture image (c) result image

111