Accès libre

A study on the application of computer graphics technology in digital painting art

 et   
19 mars 2025
À propos de cet article

Citez
Télécharger la couverture

Introduction

Digital painting is a work of art created in graphic image processing software through computers, hand drawing boards, scanners and other hardware devices, handmade and processed pixels [1]. Digital painting supported by computer technology and Internet technology belongs to the emerging cross-disciplinary, adding new elements to traditional hand-painting, re-presenting the charm of painting with dynamic digital expression and virtual interactive features, which is widely used in the fields of animation design, film and television special effects production, 3D game development, etc., and creates irreplaceable value for the development of contemporary socio-economic [25].

Digital media can be divided into three kinds from the general direction, the first is natural media, which refers to the media obtained after objective things are digitized [6]. The second type is synthetic media, which refers to media created using computers as a tool [7]. The third type is purely computer-generated media, which is generated autonomously by a computer according to a program [8]. Graphics technology plays the role of generating, editing, storing, and displaying images in which has a stage of change with the iteration of computer updates [911]. In the way of presentation has evolved from two-dimensional graphics to three-dimensional graphics and now to virtual reality [12]. In the way of operation computer graphics software not only the interface is becoming more and more intuitive, but also its operation is becoming simpler and simpler [13]. In the early days, most of them were written by scientists to generate images by code, then artists can directly use the brush tool in the software to create by hand, and then now ordinary people can generate paintings by entering descriptors in the AI tool [1415]. Digital media graphics technology has developed rapidly in more than half a century, giving birth to many new art forms and styles.

The artist’s concept is conveyed through the media, and different forms of media determine the way of dissemination and acceptance of art works. Digital painting has generated a unique art creation process through the use of digital devices such as computers, and a large number of scholars have conducted research on this emerging art form [16]. LingJuan, W. A. N. G. proposed an image drawing method that combines computer graphics drawing with image processing, which does not rely on the user’s a priori knowledge, and can automatically convert color images into images with drawing effects, helping the art of digital drawing to develop further [17]. Zhang, L. et al. observed that artists use many overlapping strokes to draw lighting effects, so they designed a content-aware generation algorithm for lighting effects into digital paintings, which uses color geometry to estimate the density of strokes in digital paintings and get usable lighting effects by color mixing, which greatly simplifies the workflow in digital paintings [18]. Sugiarto, E. et al. introduced two graphic design software for bitmap and vector graphics, Corel Draw X7 and Adobe Photoshop CS6, combining the two for mixed-media digital painting, which significantly improved the shape variability and artistic effect of the paintings in a folkloric visual illustration project [19]. Li, Z. emphasized that digital image technology and graphic design have a close connection and that graphic design needs high standards of digital technology and images for its own development, and examined the guidelines for dealing with digital image technology in graphic design to provide a theoretical basis for meeting the growing visual needs [20]. Zhang, Y. et al. explored how to use modern digital image technology to optimize traditional painting art, so that it retains the traditional flavor while keeping up with the times, based on the logic of this idea, the modern digital image technology processing strategy to improve the quality of the creation of oil paintings was analyzed, and it was considered to have a high degree of feasibility [21]. Piankarnka, V. et al. developed a digital drawing learning model based on mixed reality technology to develop practical skills in animated character design through an input, learning, assessment, and feedback process, which is of practical relevance for people involved in animated character design and development [22]. Zhou, Z. explored the potential benefits of virtual reality technology in the graphic design of digital oil painting scenes, and empirical studies have shown that the graphic design model of digital oil painting scenes based on virtual reality technology can provide designers with realistic and interactive design experiences, which facilitates the design of more creative digital painting artworks [23]. Li, Y. showed that 3D painting based on virtual reality painting technology can allow art creators to immerse themselves in the creation of paintings, provide assistance for the improvement of painting art creation concepts and expansion of skills, and provide a more efficient and convenient experience for 3D painting users through the creation of an NX digital modeling and display platform based on a cloud computing platform [24].

This paper simulates the pencil effect of a 2D image using computer graphics technology to provide algorithmic support for improving the performance of digital painting. Kirsch edge detection algorithm is used to achieve boundary extraction with directionality and summarize it to simulate hand-painted style. Generate vector fields and local streamlines, and perform line integral convolution with the passed pixel point sharpening values to simulate the pencil stroke texture. The USM-sharpened image was selected as an input to LIC instead of the white noise map to highlight the texture information of the pencil. Finally, the resultant maps of LIC are combined with the resultant maps after contour extraction to achieve a more natural pencil effect. The texture quality of the pencil strokes processed by this paper’s method is evaluated according to three indicators: smoothness, consistency, and entropy. Suggestions for the development of digital drawing art are given according to the technical characteristics of computer graphics.

Drawing simulation methods based on computer graphics technology
Application of Computer Graphics Technology in Digital Painting Art

Digital painting is a form of art that utilizes electronic computer software or digital tools to create visual art works. Digital painting is one kind of digital art, which includes computer graphics, digital camera, digital art sculpture works and other forms of expression, with high efficiency, precision, editability, reproducibility and other characteristics, and has been widely used in the field of artwork creation, design, scientific and technological research, as well as education and teaching.

The authenticity of digital painting depends on the assistance of computer graphics technology. Computer graphics technology (CG) is a type of technology that converts two-dimensional or three-dimensional images into computer display output, which can simulate graphics, brush strokes, textures, and other painting elements in digital painting. The application of computer graphics technology in digital painting art has the following aspects.

Image material organization

Computer graphics technology can sharpen or soften the image material, significantly improve the quality of fuzzy images, and then make the image outline has a stronger clarity, and can effectively remove the clutter, scratches and other operations to repair the image of the existence of defects. Can also analyze the image, the reasonable use of the opposite method, so that the roughness of the image screen to a certain extent to increase, so that the image obtained to present another kind of distinctive artistic effect.

Enrichment of color expression modes

In order to better express the art of painting, it is very important to have a rich variety of colors.RGB color model is a form of color used in computer graphics technology, which can obtain a variety of colors through the change of red, green, blue and superimposed on each other, which basically covers all the colors that can be perceived by the human vision.RGB image uses only three colors, and then with the help of the RGB model for each pixel of the image RGB assigned an intensity value between 0 and 255. RGB image only uses three colors, and then with the help of RGB model for each pixel of the image of RGB to assign an intensity value between 0 and 255, and then finally the red, green, blue, these three colors in accordance with a certain proportion of the mixture together, can be presented on the screen 16777216 kinds of colors, referred to as the 16 million colors, can greatly enrich the color performance of digital painting.

Screen Rendering

Computer graphics technology can be used to render images, and the processed images can display a variety of different texture painting effects. When used, the use of some similar to the airbrush method, dot matrix method and other painting techniques is quite necessary, which also requires the user needs to have a deep understanding of the pixel composition, color gradient composition law and skillful mastery, and has a delicate approach.

In this paper, a pencil drawing simulation method is proposed to provide technical support for the realization of better performance effects in digital painting.

Overall design of the algorithm

The design idea of this paper is to generate a pencil drawing effect image for the input 2D image. The program is mainly divided into two steps: contour extraction and internal texture generation, and then the two are merged to produce the final pencil drawing, Figure 1 shows the block diagram of the pencil drawing simulation algorithm.

Figure 1.

Block diagram of pencil drawing simulation algorithm based on image

Algorithm description
Edge detection

Accurate contours can enhance the overall effect of a picture, and general edge detection methods commonly use gradient operators [25]. In this paper, the Kirsch edge detection algorithm is used for boundary extraction with direction and boundary summarization in eight directions. [26]. The steps are as follows:

Grayscale the original color image.

Define an attenuation factor scale, the smaller the value of attenuation factor, the darker the color tone of the image.

For each pixel point, take the eight neighborhood points around it. Multiply with each template operator, sum the product and divide by scale, and store it in an array.

After all eight templates are calculated, find the maximum value and store it in the array.

After all the pixel points are computed, the image is inverted to get the experimental result map. Since the eight neighborhood points are taken, the boundary pixels are not considered for the time being when the pixel-by-pixel processing is performed, starting from i=2, j=2 and ending at xsize-1, ysize-1. Where xsize, ysize are the number of rows and columns of the grayscale image. After finding out all the new pixel values except the boundary, the neighboring rows and columns of the boundary pixels are used to fill them by rows and columns, and finally invert them, and the contour extraction is completed.

Generation of vector fields

To perform the line integral convolution operation, a vector field needs to be generated, local streamlines are generated along the direction of the vector field, and the local streamlines are carried out with the sharpened values of the pixel points they pass through, which in turn simulate the texture of a pencil drawing:

Store the original image in the array I[m][n], m and n are the width and height of the picture.

The original image is grayed out, and the processed image is stored in the array I1[m][n].

Use gradient function to find out the gradient in x and y directions of array Il[m][n], which are stored in arrays Dx[m][n] and Dy[m][n] respectively. If Il[m][n] is a 3*3 array, the process of using gradient function to find out Dx and Dy is as follows: I1=(A1A2A3B1B2B3C1C2C3) Dx=(A2-A1(A3-A1)/2A3-A2B2-B1(B3-B1)/2B3-B2C2-C1(C3-C1)/2C3-C2) Dy=(B1-A1B2-A2B3-A3(C1-A1)/2(C2-A2)/2(C3-A3)/2C1-B1C2-B2C3-B3)

The vector field map can be visualized using the 2D arrow plot function quiver().

LIC Generating Pencil Textures

Pencil drawing generation methods generally use the LIC method to simulate the texture of the pencil, and white noise is selected as the input of LIC, but its generation of pencil drawing spatial hierarchy is not strong [27]. In this paper, the sharpened USM image is selected to replace the white noise map as an input for LIC, so that the texture information of the pencil is more prominent. The principle of the USM-sharpening process is to firstly Gaussian-filter the original image to achieve the purpose of smoothing the original image, and then subtract the original image from the smooth part, so as to achieve the effect of high-pass filtering [28]. The steps are as follows:

Store the sharpened picture of the original image in the array Il[m][n], m and n are the width and height of the picture.

Divide the vector field into m*n grids.

With the conditions satisfied, a local streamline needs to be generated with each pixel point as the starting point, so any point (x, y) in the grid can be chosen as the starting point. First find the direction of the vector field corresponding to that point, and then make a straight line parallel to the vector direction of the vector field at that point, intersecting with the two edges, at this time, it is necessary to find the intersection of the local flow line passing through the point (x, y) and two of the edges.

The intersection point derived in the previous step is the starting point, and integrates symmetrically along the positive and negative directions, respectively, and the input sharpened values corresponding to all the pixel points on the flow line participate in the convolution according to the convolution kernel as the pixel values of the output texture, whose values are: F'(x,y)=i=0lF(pi)hi+i=0l'F(Pi)hii=0lhi+i=0l'hi hi=sisi+Δsik(ω)dω K(w)=1+cos(cω)2×1+cos(dω+β)2=14(1+cos(cω)+cos(dω+β)+cos(cω)cos(dω+β))

Among them:

F(Pi) and F(pi') are the pixel values at segment i in the forward and reverse direction of the streamline, respectively. hi is the result of integration of the convolution kernel in the positive direction of the streamline at segment i, and hi is the result of integration of the convolution kernel in the negative direction of the streamline at segment i, where l is taken as 10.

s0 = 0, si = si–1 + Δsi–1.

K(w) is the convolution kernel function and here the Hanning window function is chosen as it fulfills the requirement for low pass filtering. c and d are the expansion coefficients of the Hanning function and β is the phase shift of the Hanning function.

Using the LIC algorithm requires generating a local streamline from each pixel point, which is time-consuming. Moreover, when painters paint, they usually choose one direction as the main texture direction of the painting. Therefore, the LIC algorithm is simplified and the complicated process of generating local streamlines based on the vector field direction is improved so that the generated local streamlines have the same direction to unify the texture direction of the image.

Consolidation

The resultant image processed by the LIC algorithm already has obvious texture information, but the disadvantage is that the contour information in the image is not prominent, so the resultant image of LIC is merged with the resultant image after contour extraction to make the image more natural in terms of the stroke effect. The steps are as follows:

Store the LIC processed image in the array I[m][n], m and n are the width and height of the image.

Store the image after contour extraction in the array J[m][n], m and n are the width and height of the picture.

Use the imadd() function in MATLAB to merge the resultant image after contour extraction with the result after LIC processing to generate the final pencil drawing effect image. Image summing is generally used to average images over multiple images in the same scene in order to effectively reduce additive random noise.

According to the different images, the effect after the addition operation is not the same. Therefore, some adjustments can be made according to the actual situation, trying to make the image achieve a natural and harmonious effect.

Quality analysis of textures generated by the algorithm
Evaluation indicators

In order to analyze the data for sketch textures, a statistically based approach is used here to compute the textures. One method frequently used for texture analysis is based on the statistical properties of the luminance histogram. Such a metric is based on statistical moments. The nth-order moment of the mean is expressed as: μn=i=0L1(zim)np(zi) where zi is a random value representing brightness p(z) is a histogram of gray levels in a region, L is the number of possible gray levels, and m=i=0L1zip(zi) is the mean brightness.

Commonly used texture depictors for region-based luminance histograms are the following:

Mean: a measure of average luminance.

Standard Deviation: a measure of average contrast.

Smoothness: a measure of the relative smoothness of the luminance. r=0 indicates a region of constant luminance, and r=1 indicates a region with a large shift in gray level.

Consistency: a measure of consistency. This metric is largest when all gray values are equal.

Entropy: randomness metric.

The sketch texture in this paper, is to use the hierarchical lines to represent the region of the image, that is, the collection of lines to reflect the gray scale of the smooth region, therefore, the rougher its image, the better it indicates the effect of the texture, and vice versa, the smoother the image, the worse it indicates the texture. In terms of consistency, the lower the consistency, the more obvious it is that the effect of pencil texture is, and vice versa, the less obvious it is. Therefore, the following uses it to measure the effectiveness of the sketch texture in terms of smoothness, consistency, and entropy.

Pencil Texture Quality Analysis

Using the algorithm of this paper, LIC algorithm and Photoshop method, portrait sketch, still life sketch and animal sketch are generated respectively, and the generated pencil texture is compared, and the experimental results are statistically measured by texture metric. Fig. 2, Fig. 3 and Fig. 4 show the results of texture metrics of sketches of human portrait, still life and animals respectively.

Figure 2.

The quality of the pencil texture of a figure sketch

Figure 3.

The quality of the pencil texture of a still sketch

Figure 4.

The quality of the pencil texture of a animal sketch

From the texture quality evaluation results, we can see that for each image, the algorithm in this paper outperforms the other two methods, while the sketch texture achieved with Photoshop is the worst. The details are as follows:

Value of R: It can be seen that the R value of the Photoshop sketch image in each group of images is much higher than the R value of the images generated by the LIC algorithm and the algorithm of this paper, which indicates that the Photoshop sketch image is smoother and the texture effect is not good. Whereas the sketch image generated by this paper’s algorithm has lower smoothness and good texture effect and the R-value of the sketch image realized by LIC algorithm is slightly higher than that of this paper’s algorithm.

Consistency: as can be seen from the figure, the consistency values of the three Photoshop pencil sketch images are 0.2795, 0.3838 and 0.4872, respectively, which are much higher than those generated by the other two algorithms, i.e., their image grayscale values are relatively similar, which can be derived from the fact that the clarity of the texture effect is weak. And the consistency value of the sketch image generated by this paper’s algorithm is lower (mean value of 0.0087), which is lower than the sketch results generated by Photoshop and LIC algorithms at the same time, indicating that the clarity of the pencil stroke texture generated by this paper’s algorithm is stronger.

Entropy: Entropy is used to represent the randomness of the image gray scale, indicating the degree of image confusion. From the figure we can see that while the sketch image generated by this paper’s algorithm has the highest entropy value, i.e., its texture is better. The image generated by the LIC method is second. And the entropy of the Photoshop sketch image is lower than that of the other two images, so it can be seen that its texture is less effective.

Algorithm processing time comparison

The algorithm processing time experiments are carried out on a PC with Windows XP operating system and a main frequency of 2.40GHZ using Matlab 7.10.0 as a platform. The pencil simulation algorithm proposed in this paper has a better arithmetic effect in simulating the process of generating the formulated pencil strokes and a faster generation speed. Fig. 5 shows the comparison of the time required for the processing of pictures of different sizes using this algorithm and the LIC algorithm.

Figure 5.

Algorithm processing time comparison

Figure 5 shows that the pencil drawing simulation algorithm used in this paper, if the time needed to generate a 240 * 360 map is only 0.1s left, much faster than the LIC algorithm.The LIC algorithm uses the image segmentation method to generate the texture, the method generates a 240 * 360 grayscale pencil drawing the time needed for about 0.8s, while the image segmentation occupies about 80% of the entire algorithm’s time. 80% or so. In addition, the algorithm in this paper takes 0.255s to generate a 320*480 pencil drawing, which is significantly faster than the traditional LIC algorithm. In the generation of 960*1024 size of the pencil drawing, the time used is 1.32 seconds, the time consumed is only about 1/20 of the LIC algorithm, which shows that this paper’s algorithm has a significant advantage over the LIC algorithm in terms of time.

Suggestions for countermeasures to develop digital painting based on computer graphics technology

In recent years, the development of CG art in China has been in full swing, facing some of the problems raised above, so China’s CG industry should come out of a combination with the actual Chinese, with national characteristics of the development of the road, can be explored from the following aspects at present.

Enhancing the interaction between arts and technology

CG art is a multi-disciplinary cross-comprehensive discipline involving many specialized fields such as digital technology, fine arts, screenwriting and directing. When creating CG, we often encounter this awkward situation: computer personnel lack sufficient artistic training, while artists are not proficient in computer programming. Therefore, it is the best way to solve this dilemma by organizing all the professional talents into a group, dividing the work in an orderly manner, and complementing each other’s strengths and weaknesses. Chinese CG art workers should cultivate their scientific literacy when creating art, adopt scientific methods when creating, and interact art and technology perfectly to create excellent works.

Maintaining a distinctive local identity

Culture with local characteristics is the crystallization of various cultures precipitated by national habits and ways of thinking, and it is a culture that is rooted in the local area, inherited from generation to generation, and has distinctive regional characteristics. Culture with local characteristics is not only precipitated by history and tradition, but also rooted in the changes and development of real life. At present, some Chinese art creators have been imitating foreign works, which has led to the production of “four unlike” hard works, which is the loss of local characteristics of culture. China is an ancient civilization with a long history, and every province, city, and region has unique local cultural resources. Art workers should deeply immerse themselves in the treasure precipitated by thousands of years of history and culture and create shocking works of art with Chinese characteristics, instead of blindly pursuing unfamiliar foreign themes. Therefore, art workers’ in-depth study of local culture plays a vital role in the development and growth of Chinese CG art. In creation, we must use our own language and behavior to interpret the unique style of art stories.

Emphasize the cultivation of talents

The quantity and quality of talent are always signs of the rise and fall of an industry. Similarly, the quality of CG practitioners is a key factor affecting the development of CG art. At present, China has not yet established a mature talent training system, such as the opening of CG art-related majors, research of related basic theories, and training in CG technology. Therefore, China should increase the construction of CG talent training, establish related art majors in some powerful research institutes or universities, and introduce excellent CG art talents from abroad for exchanges and guidance. In addition, the construction of a professional CG education website, the establishment of CG designer clubs, regular academic exchanges, and design competitions are effective ways to improve the quality of CG practitioners.

Conclusion

In this paper, a pencil drawing simulation algorithm based on computer graphics technology is constructed to improve the realism and expressiveness of pencil strokes in the digital drawing process. The algorithms used in this paper, including the traditional LIC algorithm and the Photoshop method, were selected to generate sketch images of various material subjects and analyze their texture quality.

Among them, the pencil texture generated by Photoshop has the highest R-value, while the pencil texture generated by this paper’s algorithm has the lowest R-value, which indicates that the pencil texture generated by this paper’s algorithm has a low degree of smoothness and the best texture effect. The mean value of consistency of sketch image generated by this paper’s algorithm is 0.0087, which is lower than the level of Photoshop and LIC algorithm, which indicates that this paper’s method generates pencil stroke texture with more clarity. In addition, the entropy value of the sketch image generated by this paper’s algorithm is the highest, which also indicates that the algorithm achieves the best pencil texture effect. The time taken by this paper’s algorithm in processing 240*360, 320*480 and 960*1024 sized pencil images is 0.09788s, 0.255s and 1.32s respectively, which are all significantly smaller than the LIC algorithm.

The algorithm in this paper is thought to be able to efficiently process pencil strokes with high texture quality and provide a technical basis for improving the quality of digital painting.