3.1 Texture Synthesis Technology of Freehand Ink Painting
Texture synthesis is a popular technique for processing self-similar images. It is a method to generate an output image with unlimited size from a given input sample image. The output image is very similar to the original sample by visual observation, but not strictly consistent. It is through some small samples of mountain stone texturing that the author synthesizes a large block of complete mountain stone texturing texture, which solves the problem of the richness of texturing texture. Because the texturing method of Chinese landscape painting is formed by the combination of texturing, wiping, dyeing and spotting on suitable paper with a brush dipped in ink, which is rich in changes. The texturing method is usually composed of fine lines, which are closely combined. Sometimes the lines are rendered layer by layer, and sometimes only the texturing is wiped without stippling, thus forming the local self similarity of the texturing method texture. However, the texture structure of texturing method is not very obvious, and the shape is irregular. Given these characteristics of the texturing method of landscape painting, and considering the complexity of the algorithm, we try to use the natural texture synthesis method [10] [11] proposed by Ashikhmin, and combine the characteristics of the texturing method rendering of Chinese landscape painting to improve and optimize the algorithm accordingly. Finally, considering that the wrinkled texture of landscape painting has a certain directionality, in the final rendering, we use an alpha mask channel to guide its synthesis in three-dimensional space, aiming to achieve an artistic effect of freehand mountain and water painting similar to vivid charm, incisive ink and rich colors.
Ashikhmin proposed the synthesis method of natural texture. The so-called natural texture refers to the texture composed of some very similar but irregular small units in shape and size. Ashikhmin uses the correlation principle to limit the search scope to the neighborhood of the current point. The method of synthesizing natural texture also uses the L-shaped neighborhood of the current point, and the neighborhood size is Neighb-siz. It is not in direct proportion to the texture quality, and the optimal value depends on the texture structure. Excessive neighborhood not only affects the synthesis speed but also leads to a large number of repeated regions. when the texture is smooth, the neighborhood needs to be increased. Firstly, a large number of texturing methods in landscape paintings are collected and stored in the system as input sample images. For simplicity, we first assume that both the input sample image and the output image to be synthesized have regular sizes. Using the principle of correlation, the algorithm limits the search range to the neighborhood of the current point. According to the L-neighborhood point, candidate pixels are obtained after the corresponding position in the input image is shifted by a corresponding amount. We define an array structure for each pixel in the output image to store the position of the pixel in the input sample image, to facilitate the search for matching points of neighboring pixels. Suppose we copy the q point in the sample image to the pixel P in the output image, we can establish a data structure s (.) with p as the index, which has the following equation:
S (p )=q
In the calculation process, for each pixel synthesized, its position in the input sample image is recorded in the structure. The algorithm first initializes the array that records the positions of matching points\sout,and sets it as a random point in the input image. For each pixel in the output image, it is calculated according to the scanning line order. In the output image, consider the L-neighborhood of the current point, and for each point in the neighborhood, according to the position of the matching point in the array, after offsetting the corresponding position, select the point as the candidate point, to form a list of candidate points and clear the duplicate candidate points. Select the point with the least L-neighborhood error with the current point of the output image from the selected point, copy it to the current point of the output image, and record the position. If necessary, perform secondary or multiple syntheses until a satisfactory texture image is obtained. Figure 4 is the texturing texture effect picture synthesized by the author through texturing sampling for a traditional Chinese landscape painting.