Image processing method and device, nonvolatile storage medium and computer equipment

By calculating the color gradient of the image and adjusting the color value using smooth and Gaussian functions, the problem of low efficiency of color-lead-style images relying on manual design is solved, and mass production of high-quality color-lead-style images is achieved.

CN120355831APending Publication Date: 2025-07-22CHINA TELECOM BESTPAY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510442119.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-09
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

The prior art is difficult to achieve mass production of color-lead-style images, which is low in efficiency and relies on manual design.

Method used

By obtaining the color value of the initial image, calculating the color gradient value, adjusting the color value using the smoothing function and the Gaussian function, a target image simulated color lead style is generated.

Benefits of technology

The generation efficiency of color-lead-style images is improved and high-quality color-lead-style images are achieved in mass production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120355831A_ABST
    Figure CN120355831A_ABST
Patent Text Reader

Abstract

The invention discloses an image processing method and device, a nonvolatile storage medium and computer equipment. The method comprises the following steps: acquiring an initial image; determining initial color values corresponding to a plurality of pixel points in the initial image; calculating target color gradient values corresponding to the plurality of pixel points based on the initial color value; based on the smoothing function and the target color gradient value, adjusting initial color values corresponding to the plurality of pixel points to obtain first color values corresponding to the plurality of pixel points; adjusting the first color values based on a Gaussian function and the first color values corresponding to the adjacent pixel points corresponding to the plurality of pixel points to obtain second color values corresponding to the plurality of pixel points; based on the second color values corresponding to the multiple pixel points, the initial image is adjusted, a target image is obtained, and the target image is the initial image in the simulated colored lead style. According to the invention, the technical problems of difficulty in batch production and low efficiency due to dependence on manual design of an image with a color lead effect at present are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular, to an image processing method, apparatus, non-volatile storage medium, and computer device. Background Art

[0002] Colored pencil style images are famous for their delicate color gradients and soft texture. Due to the personalized characteristics of the colored pencil style and the characteristics of manual creation by designers, it is extremely difficult to mass-produce high-quality colored pencil style images. In the face of a large number of demands, it is impossible to quickly generate works with good consistency and quality, and the generation efficiency is low.

[0003] In view of the above problems, no effective solution has been proposed yet. Summary of the Invention

[0004] Embodiments of the present invention provide an image processing method, apparatus, non-volatile storage medium, and computer device, so as to at least solve the technical problem that it is difficult to mass-produce images with colored pencil effects depending on manual design and the efficiency is low.

[0005] According to an aspect of an embodiment of the present invention, an image processing method is provided, including: obtaining an initial image; determining initial color values corresponding to multiple pixel points in the initial image; calculating target color gradient values corresponding to the multiple pixel points based on the initial color values corresponding to the multiple pixel points; adjusting the initial color values corresponding to the multiple pixel points based on a preset smoothing function and the target color gradient values corresponding to the multiple pixel points to obtain first color values corresponding to the multiple pixel points; adjusting the first color values corresponding to the multiple pixel points based on a preset Gaussian function and the first color values corresponding to adjacent pixel points of the multiple pixel points to obtain second color values corresponding to the multiple pixel points; adjusting the initial image based on the second color values corresponding to the multiple pixel points to obtain a target image, where the target image is the initial image under the simulated colored pencil style.

[0006] Optionally, determining the initial color values corresponding to multiple pixel points in the initial image includes: receiving the color dispersion degree input based on a target account; obtaining the original color values corresponding to the multiple pixel points; adjusting the original color values corresponding to the multiple pixel points based on the color dispersion degree to obtain the initial color values corresponding to the multiple pixel points.

[0007] Optionally, calculating the target color gradient values corresponding to the multiple pixel points based on the initial color values corresponding to the multiple pixel points respectively, includes: establishing a two-dimensional coordinate system based on the initial image; determining the first color gradient values corresponding to the multiple pixel points respectively based on the initial color values of the adjacent pixel points of the multiple pixel points in the x-axis direction in the two-dimensional coordinate system; determining the second color gradient values corresponding to the multiple pixel points respectively based on the initial color values of the adjacent pixel points of the multiple pixel points in the y-axis direction in the two-dimensional coordinate system; determining the target color gradient values corresponding to the multiple pixel points respectively based on the first color gradient values and the second color gradient values corresponding to the multiple pixel points respectively.

[0008] Optionally, adjusting the initial color values corresponding to the multiple pixel points respectively based on a preset smoothing function and the target color gradient values corresponding to the multiple pixel points respectively, to obtain the first color values corresponding to the multiple pixel points respectively, includes: determining the pixel points with target color gradient values exceeding a preset threshold among the multiple pixel points as edge pixel points; adjusting the initial color values corresponding to the edge pixel points based on the smoothing function to obtain the first color values corresponding to the edge pixel points.

[0009] Optionally, adjusting the first color values corresponding to the multiple pixel points respectively based on a preset Gaussian function and the first color values corresponding to the adjacent pixel points of the multiple pixel points respectively, to obtain the second color values corresponding to the multiple pixel points respectively, includes: determining a Gaussian weight matrix based on the Gaussian function; determining the adjacent pixel points corresponding to the multiple pixel points respectively based on a preset color influence range; calculating the weighted average color values of the adjacent pixel points corresponding to the multiple pixel points respectively based on the Gaussian weight matrix; adjusting the first color values corresponding to the multiple pixel points respectively based on the weighted average color values of the adjacent pixel points corresponding to the multiple pixel points respectively, to obtain the second color values corresponding to the multiple pixel points respectively.

[0010] Optionally, adjusting the initial image based on the second color values corresponding to the multiple pixel points respectively, to obtain a target image, includes: randomly generating noise values for the multiple pixel points; determining the color influence values corresponding to the multiple pixel points respectively based on the noise values corresponding to the multiple pixel points respectively, where the color influence value characterizes the rough feeling of simulating a real pencil; adjusting the initial image based on the second color values corresponding to the multiple pixel points respectively and the color influence values corresponding to the multiple pixel points respectively, to obtain the target image.

[0011] According to another aspect of the embodiments of the present invention, there is also provided an image processing apparatus, including: an acquisition module configured to acquire an initial image; a determination module configured to determine initial color values corresponding to respective ones of a plurality of pixel points in the initial image; a calculation module configured to calculate target color gradient values corresponding to respective ones of the plurality of pixel points based on the initial color values corresponding to respective ones of the plurality of pixel points; a first adjustment module configured to adjust the initial color values corresponding to respective ones of the plurality of pixel points based on a preset smoothing function and the target color gradient values corresponding to respective ones of the plurality of pixel points to obtain first color values corresponding to respective ones of the plurality of pixel points; a second adjustment module configured to adjust the first color values corresponding to respective ones of the plurality of pixel points based on a preset Gaussian function and the first color values corresponding to adjacent pixel points corresponding to respective ones of the plurality of pixel points to obtain second color values corresponding to respective ones of the plurality of pixel points; and a third adjustment module configured to adjust the initial image based on the second color values corresponding to respective ones of the plurality of pixel points to obtain a target image, where the target image is the initial image in an analog colored pencil style.

[0012] According to still another aspect of the embodiments of the present invention, there is also provided a non-volatile storage medium, the non-volatile storage medium including a stored program, wherein when the program runs, it controls the device where the non-volatile storage medium is located to execute any one of the above image processing methods.

[0013] According to yet another aspect of the embodiments of the present invention, there is also provided a computer device, the computer device including a processor, the processor being configured to run a program, wherein when the program runs, it executes any one of the above image processing methods.

[0014] According to yet another aspect of the embodiments of the present invention, there is also provided a computer program product, including a computer program, where when the computer program is executed by a processor, it implements any one of the above image processing methods.

[0015] In an embodiment of the present invention, an image processing method is adopted. By obtaining an initial image; determining the initial color values corresponding to multiple pixel points in the initial image; calculating the target color gradient values corresponding to multiple pixel points based on the initial color values corresponding to multiple pixel points; adjusting the initial color values corresponding to multiple pixel points based on a preset smoothing function and the target color gradient values corresponding to multiple pixel points to obtain the first color values corresponding to multiple pixel points; adjusting the first color values corresponding to multiple pixel points based on a preset Gaussian function and the first color values corresponding to the adjacent pixel points of multiple pixel points to obtain the second color values corresponding to multiple pixel points; adjusting the initial image based on the second color values corresponding to multiple pixel points to obtain a target image, where the target image is the initial image in the simulated colored pencil style, achieving the purpose of generating a colored pencil style image through multiple functions, thereby realizing the technical effect of improving the generation efficiency of colored pencil style images, and further solving the technical problem that currently, images with colored pencil effects are difficult to mass-produce and have low efficiency due to relying on manual design. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The illustrative embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation to the present invention. In the drawings:

[0017] Figure 1 shows a hardware structure block diagram of a computer terminal for implementing the image processing method;

[0018] Figure 2 is a flowchart of the image processing method provided by an embodiment of the present invention;

[0019] Figure 3 is a schematic diagram of the initial image and the target image of the image processing method provided by an optional embodiment of the present invention;

[0020] Figure 4 is a block diagram of the structure of the image processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0021] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0022] It should be noted that the terms "first", "second", etc. in the description, claims and above-mentioned drawings of the present invention are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present invention described here can be implemented in an order different from those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily limit to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0023] According to an embodiment of the present invention, a method embodiment of an image processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that here.

[0024] The method embodiment provided by the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 A hardware structure block diagram of a computer terminal for implementing an image processing method is shown. As Figure 1 shown, the computer terminal 10 may include one or more (shown as 102a, 102b,..., 102n in the figure) processors (the processor may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 104 for storing data. In addition, it may further include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic and does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 may further include more or fewer components than Figure 1 shown, or have a different configuration from Figure 1 shown.

[0025] It should be noted that one or more of the above-mentioned processors and / or other data processing circuits can generally be referred to as "data processing circuits" herein. The data processing circuit can be embodied in whole or in part as software, hardware, firmware, or any combination thereof. In addition, the data processing circuit can be a single independent processing module, or be incorporated in whole or in part into any one of the other elements in the computer terminal 10. As involved in the embodiments of the present application, the data processing circuit is a kind of processor control (such as the selection of a variable resistance terminal path connected to an interface).

[0026] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the image processing method in the embodiments of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implements the image processing method of the above-mentioned application program. The memory 104 can include a high-speed random access memory, and can also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 can further include a memory remotely set relative to the processor, and these remote memories can be connected to the computer terminal 10 through a network. Examples of the above-mentioned network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and combinations thereof.

[0027] The display can be, for example, a touch-screen liquid crystal display (LCD), which enables a user to interact with the user interface of the computer terminal 10.

[0028] Figure 2 is a schematic flowchart of the image processing method provided according to the embodiments of the present invention, as Figure 2 shown, the method includes the following steps:

[0029] Step S202, obtain an initial image.

[0030] In this step, the obtained initial image is the image to be generated in a colored pencil style.

[0031] Step S204, determine the initial color value corresponding to each of the multiple pixel points in the initial image.

[0032] In this step, determining the initial color values corresponding to multiple pixel points in the initial image is a fundamental step in image processing and computer vision algorithms, which usually involves sampling the color information of each pixel from the image texture. In the shader language (GLSL) of WebGL or OpenGL, this process can be completed through texture sampling functions, such as the texture() function. Usually, the texture coordinates are normalized, which enables the texture sampling function to correctly map to the width and height of the image. In the context of WebGL or OpenGL, these texture coordinates are usually passed from the vertex shader to the fragment shader, or obtained through mechanisms such as vertex attributes, vertex arrays, and image units.

[0033] In specific image processing tasks, the obtained initial color values will be further processed, such as performing color conversion, blurring, edge detection, style conversion, etc., to achieve the desired effects. For example, in the shader for simulating the colored pencil style effect, we can perform operations such as Gaussian blurring, edge detection, and color quantization on these initial color values to simulate the soft color transitions and delicate lines in colored pencil drawings.

[0034] Step S206: Calculate the target color gradient values corresponding to multiple pixel points based on the initial color values corresponding to multiple pixel points.

[0035] In this step, the target color gradient values can be calculated based on the initial color values corresponding to multiple pixel points. The color gradient reflects the local change in color intensity or brightness in the image and is very useful for generating artistic style image effects, such as the pencil drawing style, because it can help us locate the contours and details in the image. In GLSL (OpenGL Shading Language), calculating the color gradient usually involves sampling the color values of adjacent pixels and then estimating the gradients of the pixels in the x and y directions through differential operations. Specifically, the following gradient calculation formula can be used for calculation, where C(x, y) is the color value of the pixel at coordinates (x, y), is the gradient value in the x direction, is the gradient value in the y direction:

[0036]

[0037] For a color image, the color value of each pixel consists of three RGB channels. When calculating the gradient, these three channels need to be processed separately. Specifically, for each pixel, the color values of its surrounding pixels (left, right, above, and below) can be obtained, and normalized texture coordinates are usually used for sampling. How to calculate the gradients in the x and y directions using the central difference method (or Sobel operator, etc.). For a color image, the gradient values of each RGB channel can be calculated, and then the gradient values of the RGB channels can be combined to obtain the final color gradient value.

[0038] The calculated gradient values can be used for further image processing, such as thresholding to highlight edges, non-maximum suppression to reduce noise, double-threshold detection to determine strong and weak edges, etc. When generating the artistic style image effect, these gradient values are usually used to guide color mixing or line generation to achieve the desired visual effect.

[0039] Step S208: Based on a preset smoothing function and the target color gradient values corresponding to multiple pixels, adjust the initial color values corresponding to multiple pixels to obtain the first color values corresponding to multiple pixels.

[0040] In this step, adjusting the initial color values of pixels based on the preset smoothing function and the smoothed target color gradient values is a key technique in image processing to enhance edge sharpness and achieve a delicate transition effect. This process usually involves using a smoothing function to process the gradient values to ensure that the change in the final color values is more natural, avoiding the influence of harsh edges or noise. Smoothing functions such as smoothstep are widely used in GLSL to control the smooth transition of color or brightness. The smoothstep function accepts three parameters: two boundary values and an input value, and it returns a value that smoothly changes between the boundary values. This function is particularly important for generating the pencil line effect because it ensures that the lines transition smoothly between pixels, avoiding sudden changes in color or brightness and making the effect look more natural. Specifically, the smoothTransition function uses smoothstep to control the transition of edge gradient values. thresholdLow and thresholdHigh are preset boundary values used to define the range of the smoothstep function. The initial color value of each pixel can be obtained first through the texture function, and then the color gradient values are smoothed to ensure a more natural transition of the line effect. If the smoothed edge gradient value is greater than the target gradient value, the line effect of the pixel is enhanced; otherwise, its initial color value remains unchanged.

[0041] In this way, while maintaining the overall color of the image, the lines and edges that need to be highlighted can be enhanced to generate a delicate and artistic pencil line effect. Subsequently, further processing such as blending and overlaying can be performed based on these first color values to achieve the final image effect.

[0042] In practical applications, the setting of the target gradient value and the threshold will be adjusted according to the specific image and the required effect to obtain the best visual effect. The combination of the smoothing function and the smoothed gradient value can ensure that the lines are both prominent and natural, avoiding the common problems of harsh edges or unnatural transitions in image processing.

[0043] Step S210: Based on a preset Gaussian function and the first color values corresponding to the adjacent pixels of each of the multiple pixel points, adjust the first color values corresponding to each of the multiple pixel points to obtain the second color values corresponding to each of the multiple pixel points.

[0044] In this step, blurring the image based on the preset Gaussian function is a key step to adjust the color values of these pixel points to obtain the second color values starting from the first color values of multiple pixel points and their adjacent pixel points. Gaussian blur is a widely used filtering technique in image processing. It can smooth the image, reduce noise, and generate a natural blurring effect. In WebGL or OpenGL's GLSL, Gaussian blur is usually achieved by performing a convolution operation in the fragment shader, where the Gaussian function defines the weights of the convolution kernel. For each pixel point, the pixel range to be sampled around can be defined first, and then the weights of each sampled pixel point can be calculated. The color value of the sampled pixel point is multiplied by its weight and accumulated into the total color value, and at the same time, the influence weights of different pixel points on it are accumulated to calculate the total weight. Finally, the blurred color value of the pixel point, that is, the second color value, is obtained by dividing the total color value by the total weight. In this way, the output image visually presents a Gaussian blur effect, which can be used to simulate the color diffusion effect in the colored pencil style.

[0045] Specifically, the Gaussian weight matrix can be pre-calculated and stored, so that the pre-calculated weights can be directly used during runtime, avoiding real-time calculation of the Gaussian function, thereby improving efficiency. In WebGL or OpenGL, techniques such as vertex buffer and texture coordinate transformation can be used to achieve efficient Gaussian blur processing. The fineness and range of the blur effect can also be controlled to achieve different visual styles.

[0046] Step S212: Based on the second color values corresponding to each of the multiple pixel points, adjust the initial image to obtain a target image, where the target image is the initial image in the simulated colored pencil style.

[0047] In this step, based on the second color values corresponding to multiple pixels (i.e., the color values after Gaussian blur processing), the initial image is adjusted to obtain the target image, which is the initial image in the simulated colored pencil style. Starting from the second color values, the image effect in the colored pencil style is further simulated. By synthesizing the processed colors above, the obtained target image will present a colored pencil style with soft color transitions and delicate lines.

[0048] In actual application scenarios, adjustments can be made according to specific requirements to achieve different colored pencil effects. The size of the texture, the degree of blur, etc. will also affect the final colored pencil style effect. By flexibly adjusting these parameters, personalized colored pencil images can be created without losing the details of the original image.

[0049] Figure 3 It is a schematic diagram of the initial image and the target image of the image processing method provided according to an optional embodiment of the present invention, as Figure 3 shown. The original image on the left is the initial image, and the corresponding image of the colored pencil on the right is the target image.

[0050] Through the above steps, the purpose of generating a colored pencil style image through multiple functions is achieved, thereby realizing the technical effect of improving the generation efficiency of the colored pencil style image, and further solving the technical problem that the image with the colored pencil effect currently depends on manual design and is difficult to achieve mass production with low efficiency.

[0051] As an optional embodiment, determining the initial color values corresponding to multiple pixels in the initial image includes: receiving the color dispersion degree input based on the target account; obtaining the original color values corresponding to multiple pixels; and adjusting the original color values corresponding to multiple pixels based on the color dispersion degree to obtain the initial color values corresponding to multiple pixels.

[0052] Optionally, the color dispersion degree parameter determines the degree of simplification of the image color, that is, the number of colors in the image. A higher dispersion degree parameter will retain more color details, while a lower value will make the image colors more unified and simplified. This parameter is usually set by the user or the application according to the requirements, can be received through the Web front-end interface, and then passed into the shader of WebGL. In WebGL, the original color values can be obtained from the image texture through a texture sampler. The texture coordinates are usually obtained by normalizing the position of the current pixel on the screen, and then the original color values are sampled from the input texture through these texture coordinates. Adjustment based on the color dispersion degree parameter usually involves color quantization, mapping each color value to a discrete color palette to reduce the color complexity in the image.

[0053] By receiving the color dispersion degree parameter input based on the target account and then performing color quantization adjustment on the original color values of each pixel point in the fragment shader, an image with fewer color levels can be generated, laying a foundation for subsequent colored pencil style image generation. This way of generating the initial color values reduces color details while retaining the basic features of the image, making the image closer to the colored pencil style in artistic creation.

[0054] In practical applications, the color dispersion degree parameter can be adjusted according to specific requirements. For example, a larger value will retain more details, while a smaller value will make the image colors more unified, approaching the color block effect commonly seen in colored pencil paintings. In this way, the application can provide adjustable parameters for users to adapt to different preferences and application scenarios.

[0055] As an optional embodiment, based on the initial color values corresponding to multiple pixel points, calculating the target color gradient values corresponding to multiple pixel points includes: establishing a two-dimensional coordinate system based on the initial image; determining the first color gradient values corresponding to multiple pixel points based on the initial color values of adjacent pixel points in the x-axis direction of the two-dimensional coordinate system for multiple pixel points; determining the second color gradient values corresponding to multiple pixel points based on the initial color values of adjacent pixel points in the y-axis direction of the two-dimensional coordinate system for multiple pixel points; and determining the target color gradient values corresponding to multiple pixel points based on the first color gradient values and the second color gradient values corresponding to multiple pixel points.

[0056] Optionally, in image processing, calculating the target color gradient value based on the initial color values of multiple pixel points can be used to identify edges and details in the image, which is particularly important for generating artistic style images such as colored pencil style images. Implementing this process in the GLSL shader can be achieved by establishing a two-dimensional coordinate system, calculating the color gradients in the x-axis and y-axis directions, and synthesizing the target color gradient value.

[0057] In GLSL, the built-in variable gl_FragCoord in the fragment shader is usually used to represent the position of the current pixel in the screen coordinate system. However, for better image processing, we usually map the coordinates to the native resolution of the image, that is, the pixel position in the two-dimensional coordinate system. To calculate the color gradient value, the initial color values of the current pixel point and its adjacent pixel points can be sampled, and then the differential method can be used to calculate the color changes in the x-axis and y-axis directions. In WebGL, the color values of adjacent pixels can be sampled by modifying the texture coordinates, and then the differences between these values can be calculated. After calculating the color gradient values in the x-axis and y-axis directions, the final target color gradient value can be obtained by calculating the magnitude of the gradient (i.e., the size of the gradient vector), which will help us identify the intensity and direction of the color change, thus better simulating the edges and details in the colored pencil style.

[0058] Through the above steps, the target color gradient value can be calculated based on the initial color value of the pixel points in the GLSL shader, which is crucial for the generation of colored pencil style images. It allows us to identify details and edges in the image, and then perform subsequent image processing, such as line enhancement, color quantization, and blur effects, so that the image presents delicate lines and soft color transitions, achieving the visual effect of the colored pencil style. In practical applications, the accuracy and directionality of the gradient calculation can be optimized by adjusting the sampling offset delta and the gradient calculation method to meet the requirements of different images and styles.

[0059] As an alternative embodiment, based on a preset smoothing function and the target color gradient values corresponding to multiple pixel points, the initial color values corresponding to multiple pixel points are adjusted to obtain the first color values corresponding to multiple pixel points, including: determining the pixel points with target color gradient values exceeding a preset threshold among the multiple pixel points as edge pixel points; based on the smoothing function, adjusting the initial color values corresponding to the edge pixel points to obtain the first color values corresponding to the edge pixel points.

[0060] Optionally, the target color gradient value can be used to determine which pixel points are edge pixel points. The identification of edge pixel points is based on the target color gradient value exceeding a preset threshold, which usually involves comparing the gradient value of each pixel point with a determined threshold. The setting of the threshold depends on the specific image effect requirements, which defines what kind of changes will be considered as "edges". Once the edge pixel points are determined, their color values can also be adjusted through a smoothing function to achieve the effect of simulating soft edges in the colored pencil style. The smoothing function usually adopts a simple mathematical function, such as smoothstep or lerp (linear interpolation), to ensure that the color change is not too sudden but smooth. Taking the smoothstep function as an example, it is usually used to provide a smooth transition between two thresholds. For example, when using smoothstep to adjust the color value of edge pixel points, the range of its edge strength can be set. For example, a smooth transition is performed between an edge strength of 0.2 and 0.8. The smoothstep function is used to smooth the edge strength, and then the mix function is used to mix the initial color value and a preset color value (such as white, representing the high brightness of the pencil line), and the mixing ratio is determined by the smoothed edge strength. For edge pixel points, the adjusted first color value is output; for non-edge pixel points, the color remains unchanged, that is, the initial color value is used.

[0061] Through the above steps, it is possible to ensure that the color values of the edge pixels are visually softer and more natural, simulating the delicate lines and contour effects in the colored pencil style. The application of the smoothing function, especially smoothstep, can effectively control the smoothness of the transition, avoiding hard edges and sudden color changes, making the image effect more artistic and realistic. In practical applications, parameters such as the edge threshold and the smoothing range can be adjusted according to specific requirements to achieve the best visual effect.

[0062] As an alternative embodiment, based on a preset Gaussian function and the first color values corresponding to the adjacent pixels of each of the multiple pixels, adjusting the first color values corresponding to each of the multiple pixels to obtain the second color values corresponding to each of the multiple pixels includes: determining a Gaussian weight matrix based on the Gaussian function; determining the adjacent pixels corresponding to each of the multiple pixels based on a preset color influence range; calculating the weighted average color values of the adjacent pixels corresponding to each of the multiple pixels based on the Gaussian weight matrix; and adjusting the first color values corresponding to each of the multiple pixels based on the weighted average color values of the adjacent pixels corresponding to each of the multiple pixels to obtain the second color values corresponding to each of the multiple pixels.

[0063] Optionally, using the Gaussian function to determine the Gaussian weight matrix and calculate the weighted average color value of the adjacent pixels can be used to simulate color diffusion in the colored pencil effect. The Gaussian function defines the degree of influence of other pixels near each pixel. The size of the weight matrix depends on the preset color influence range, and usually a one-dimensional or two-dimensional Gaussian kernel is used. If a one-dimensional Gaussian kernel is used to simplify the calculation, two independent horizontal and vertical blurs can be performed through the one-dimensional kernel to achieve the same effect as two-dimensional Gaussian blur. In the initialization stage of the shader, a one-dimensional Gaussian weight matrix can be calculated and stored in an array for subsequent use. Then, determine the adjacent pixels corresponding to each of the multiple pixels. This step involves determining which pixels are the "adjacent" pixels of the current pixel, usually the pixels within a radius of the preset color influence range around the current pixel. For example, if the influence range is 3, the 3 pixels to the left, right, above, and below the current pixel will all be adjacent pixels. The getWeightedColor function can be used, which is used to calculate the weighted average color value of the current pixel and its adjacent pixels in the horizontal and vertical directions. The pre-calculated Gaussian weight matrix is used to weight these samples. Then, adjust the first color value based on the weighted average color value to obtain the second color value. This can be achieved through simple color mixing, where the weighted average color value is used as the new value affecting the first color value.

[0064] Specifically, the weighted average color value weightedColor can be calculated first, and then the mix function can be used to mix the first color value and the weighted average color value to obtain the second color value. The mixing ratio can be adjusted according to specific effect requirements. For example, using a higher mixing ratio can produce a more obvious blurring effect.

[0065] Through the above steps, it is possible to calculate the Gaussian weight matrix based on the Gaussian function in the GLSL shader, determine adjacent pixel points and perform weighted averaging, and adjust the first color value to obtain the second color value, thereby achieving the Gaussian blur effect of the image. This blurring effect can simulate the natural diffusion of pigments on paper in the colored pencil style, enhancing the softness and layering of the image. In practical applications, parameters such as the color influence range, Gaussian standard deviation, and mixing ratio can be adjusted according to requirements to obtain the best visual effect.

[0066] As an optional embodiment, based on the second color values respectively corresponding to multiple pixel points, the initial image is adjusted to obtain the target image, including: randomly generating noise values for the multiple pixel points; determining the color influence values respectively corresponding to the multiple pixel points based on the noise values respectively corresponding to the multiple pixel points, where the color influence value represents the roughness of simulating a real pencil; adjusting the initial image based on the second color values respectively corresponding to the multiple pixel points and the color influence values respectively corresponding to the multiple pixel points to obtain the target image.

[0067] Optionally, the roughness of the pencil in the colored pencil style can be simulated by randomly generating noise values for each pixel point through a noise function and adjusting the color based on the noise values.

[0068] In GLSL, we can use a pseudo-random number generation method to generate a noise value for each pixel point. The randomness of the noise value can enhance the texture of the image, making it look more like a hand-drawn effect. The noise can be generated using the pixel position and a time variable to ensure that the noise changes each time it is rendered, avoiding repetitive texture patterns.

[0069] A random value between 0 and 1 can be generated using the pixel position uv and the time variable t. The fract function is used to obtain the fractional part of a number, and the combination of the sin and dot functions is used to generate the seed for the random number. The time variable t is usually a variable passed in from the outside, which can be the rendering time of each frame to ensure that the noise changes over time in the animation. The color influence value reflects the degree of influence of the noise on the color of the pixel. This is usually a value between 0 and 1, where 0 means the noise has no influence on the color and 1 means the noise has the maximum influence on the color. Based on the magnitude of the noise value, a smoothing function such as smoothstep can be used to determine the color influence value to ensure a natural and gradual influence. With the second color value and the color influence value for each pixel, these influence values can be combined with the second color value to make the final adjustment to the image. This adjustment can be done by color blending or modifying the color values to reflect the effect of the pencil roughness. For example, by adjusting the brightness or saturation of the color, the different pressure effects of the pencil can be simulated.

[0070] Through the above steps, it is possible to implement the generation and application of the color influence value based on noise in the GLSL shader, thereby simulating the rough texture of a pencil on the image. This method enhances the artistic effect of the image through pixel-level randomness, making it look closer to a hand-drawn style. In practical applications, the generation and influence strategy of the noise can be adjusted according to specific requirements to adapt to different artistic styles and visual effects. In addition, by controlling the noise influence range, the intensity of the roughness can be adjusted to further optimize the colored pencil style of the image.

[0071] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.

[0072] Through the description of the above embodiments, those skilled in the art can clearly understand that the image processing method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to enable a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.

[0073] According to an embodiment of the present invention, there is also provided an image processing apparatus for implementing the above image processing method. Figure 4 It is a structural block diagram of the image processing apparatus provided according to an embodiment of the present invention, as Figure 4 shown. The image processing apparatus includes: an acquisition module 402, a determination module 404, a calculation module 406, a first adjustment module 408, a second adjustment module 410, and a third adjustment module 412. The following is an explanation of the image processing apparatus.

[0074] The acquisition module 402 is configured to acquire an initial image.

[0075] The determination module 404, connected to the acquisition module 402, is configured to determine the initial color values corresponding to the respective multiple pixel points in the initial image.

[0076] The calculation module 406, connected to the determination module 404, is configured to calculate the target color gradient values corresponding to the respective multiple pixel points based on the initial color values corresponding to the respective multiple pixel points.

[0077] The first adjustment module 408, connected to the calculation module 406, is configured to adjust the initial color values corresponding to the respective multiple pixel points based on a preset smoothing function and the target color gradient values corresponding to the respective multiple pixel points, to obtain the first color values corresponding to the respective multiple pixel points.

[0078] The second adjustment module 410, connected to the first adjustment module 408, is configured to adjust the first color values corresponding to the respective multiple pixel points based on a preset Gaussian function and the first color values corresponding to the adjacent pixel points corresponding to the respective multiple pixel points, to obtain the second color values corresponding to the respective multiple pixel points.

[0079] The third adjustment module 412, connected to the second adjustment module 410, is configured to adjust the initial image based on the second color values corresponding to the respective multiple pixel points, to obtain a target image, where the target image is the initial image in a simulated colored pencil style.

[0080] Optionally, the determination module is configured to determine the initial color values corresponding to the respective multiple pixel points in the initial image, including: a receiving unit configured to receive the color dispersion degree input based on a target account; an obtaining unit configured to obtain the original color values corresponding to the respective multiple pixel points; and a first adjustment unit configured to adjust the original color values corresponding to the respective multiple pixel points based on the color dispersion degree, to obtain the initial color values corresponding to the respective multiple pixel points.

[0081] Optionally, the calculation module is used to calculate the target color gradient value corresponding to each of the multiple pixel points based on the initial color value corresponding to each of the multiple pixel points, including: a building unit for building a two-dimensional coordinate system based on the initial image; a first determination unit for determining the first color gradient value corresponding to each of the multiple pixel points based on the initial color values of the adjacent pixel points of the multiple pixel points in the x-axis direction in the two-dimensional coordinate system; a second determination unit for determining the second color gradient value corresponding to each of the multiple pixel points based on the initial color values of the adjacent pixel points of the multiple pixel points in the y-axis direction in the two-dimensional coordinate system; and a third determination unit for determining the target color gradient value corresponding to each of the multiple pixel points based on the first color gradient value and the second color gradient value corresponding to each of the multiple pixel points.

[0082] Optionally, the first adjustment module is used to adjust the initial color value corresponding to each of the multiple pixel points based on a preset smoothing function and the target color gradient value corresponding to each of the multiple pixel points, so as to obtain the first color value corresponding to each of the multiple pixel points, including: a fourth determination unit for determining the pixel points with the target color gradient value exceeding the preset threshold among the multiple pixel points as edge pixel points; and a second adjustment unit for adjusting the initial color value corresponding to the edge pixel points based on the smoothing function to obtain the first color value corresponding to the edge pixel points.

[0083] Optionally, the second adjustment module is used to adjust the first color value corresponding to each of the multiple pixel points based on a preset Gaussian function and the first color value corresponding to the adjacent pixel points of each of the multiple pixel points, so as to obtain the second color value corresponding to each of the multiple pixel points, including: a fifth determination unit for determining a Gaussian weight matrix based on the Gaussian function; a sixth determination unit for determining the adjacent pixel points corresponding to each of the multiple pixel points based on a preset color influence range; a calculation unit for calculating the weighted average color value of the adjacent pixel points corresponding to each of the multiple pixel points based on the Gaussian weight matrix; and a third adjustment unit for adjusting the first color value corresponding to each of the multiple pixel points based on the weighted average color value of the adjacent pixel points corresponding to each of the multiple pixel points to obtain the second color value corresponding to each of the multiple pixel points.

[0084] Optionally, the third adjustment module is used to adjust the initial image based on the second color value corresponding to each of the multiple pixel points to obtain a target image, including: a generation unit for randomly generating a noise value for each of the multiple pixel points; a seventh determination unit for determining the color influence value corresponding to each of the multiple pixel points based on the noise value corresponding to each of the multiple pixel points, where the color influence value represents the rough feeling of simulating a real pencil; and a fourth adjustment unit for adjusting the initial image based on the second color value corresponding to each of the multiple pixel points and the color influence value corresponding to each of the multiple pixel points to obtain the target image.

[0085] It should be noted here that the above-mentioned acquisition module 402, determination module 404, calculation module 406, first adjustment module 408, second adjustment module 410, and third adjustment module 412 correspond to steps S202 to S212 in the embodiment. The instances and application scenarios implemented by the multiple modules and the corresponding steps are the same, but are not limited to the content disclosed in the above embodiment. It should be noted that the above modules, as part of the device, can run in the computer terminal 10 provided in the embodiment.

[0086] Embodiments of the present invention can provide a computer device. Optionally, in this embodiment, the above computer device can be located in at least one of multiple network devices in a computer network. The computer device includes a memory and a processor.

[0087] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the image processing method and device in the embodiments of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implements the above-mentioned image processing method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory may further include a memory remotely provided relative to the processor, and these remote memories can be connected to the computer terminal through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and combinations thereof.

[0088] The processor can call the information and application programs stored in the memory through a transmission device to execute the following steps: obtaining an initial image; determining the initial color values corresponding to multiple pixel points in the initial image; calculating the target color gradient values corresponding to multiple pixel points based on the initial color values corresponding to multiple pixel points; adjusting the initial color values corresponding to multiple pixel points based on a preset smoothing function and the target color gradient values corresponding to multiple pixel points to obtain the first color values corresponding to multiple pixel points; adjusting the first color values corresponding to multiple pixel points based on a preset Gaussian function and the first color values corresponding to the adjacent pixel points of multiple pixel points to obtain the second color values corresponding to multiple pixel points; adjusting the initial image based on the second color values corresponding to multiple pixel points to obtain a target image, where the target image is the initial image in the simulated colored pencil style.

[0089] By adopting the embodiment of the present invention, a method for image processing is provided. The method includes: obtaining an initial image; determining initial color values corresponding to multiple pixel points in the initial image; calculating target color gradient values corresponding to the multiple pixel points based on the initial color values corresponding to the multiple pixel points; adjusting the initial color values corresponding to the multiple pixel points based on a preset smoothing function and the target color gradient values corresponding to the multiple pixel points to obtain first color values corresponding to the multiple pixel points; adjusting the first color values corresponding to the multiple pixel points based on a preset Gaussian function and the first color values corresponding to adjacent pixel points of the multiple pixel points to obtain second color values corresponding to the multiple pixel points; and adjusting the initial image based on the second color values corresponding to the multiple pixel points to obtain a target image, where the target image is the initial image in a simulated colored pencil style. The method achieves the purpose of generating a colored pencil style image through multiple functions, thereby realizing the technical effect of improving the generation efficiency of the colored pencil style image, and further solving the technical problem that the currently colored pencil effect images rely on manual design and are difficult to achieve mass production with low efficiency.

[0090] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the relevant hardware of the terminal device through a program, and the program can be stored in a non-volatile storage medium. The storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, etc.

[0091] The embodiment of the present invention also provides a non-volatile storage medium. Optionally, in this embodiment, the non-volatile storage medium can be used to store the program code executed by the image processing method provided in the above embodiment.

[0092] Optionally, in this embodiment, the non-volatile storage medium can be located in any one of the computer terminals in a computer terminal group in a computer network, or in any one of the mobile terminals in a mobile terminal group.

[0093] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: obtaining an initial image; determining initial color values corresponding to multiple pixel points in the initial image; calculating target color gradient values corresponding to the multiple pixel points based on the initial color values corresponding to the multiple pixel points; adjusting the initial color values corresponding to the multiple pixel points based on a preset smoothing function and the target color gradient values corresponding to the multiple pixel points to obtain first color values corresponding to the multiple pixel points; adjusting the first color values corresponding to the multiple pixel points based on a preset Gaussian function and the first color values corresponding to adjacent pixel points of the multiple pixel points to obtain second color values corresponding to the multiple pixel points; adjusting the initial image based on the second color values corresponding to the multiple pixel points to obtain a target image, where the target image is the initial image in a simulated colored pencil style.

[0094] An embodiment of the present invention also provides a computer program product, including a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, it can implement: obtaining an initial image; determining initial color values corresponding to multiple pixel points in the initial image; calculating target color gradient values corresponding to the multiple pixel points based on the initial color values corresponding to the multiple pixel points; adjusting the initial color values corresponding to the multiple pixel points based on a preset smoothing function and the target color gradient values corresponding to the multiple pixel points to obtain first color values corresponding to the multiple pixel points; adjusting the first color values corresponding to the multiple pixel points based on a preset Gaussian function and the first color values corresponding to adjacent pixel points of the multiple pixel points to obtain second color values corresponding to the multiple pixel points; adjusting the initial image based on the second color values corresponding to the multiple pixel points to obtain a target image, where the target image is the initial image in a simulated colored pencil style.

[0095] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments.

[0096] In the above embodiments of the present invention, the descriptions of the respective embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0097] In several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are merely illustrative. For example, the division of the units can be a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of units or modules can be in electrical or other forms.

[0098] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0099] In addition, in each embodiment of the present invention, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0100] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention. The foregoing storage medium includes: USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs and other various media that can store program codes.

[0101] The above is only the preferred embodiment of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.

Claims

1. An image processing method, characterized in that, including: obtaining an initial image; determining initial color values corresponding to respective ones of a plurality of pixel points in the initial image; calculating target color gradient values corresponding to respective ones of the plurality of pixel points based on the initial color values corresponding to respective ones of the plurality of pixel points; adjusting the initial color values corresponding to respective ones of the plurality of pixel points based on a preset smoothing function and the target color gradient values corresponding to respective ones of the plurality of pixel points to obtain first color values corresponding to respective ones of the plurality of pixel points; adjusting the first color values corresponding to respective ones of the plurality of pixel points based on a preset Gaussian function and the first color values corresponding to adjacent pixel points corresponding to respective ones of the plurality of pixel points to obtain second color values corresponding to respective ones of the plurality of pixel points; adjusting the initial image based on the second color values corresponding to respective ones of the plurality of pixel points to obtain a target image, where the target image is the initial image in an analog colored pencil style.

2. The method according to claim 1, wherein The determining the initial color values corresponding to respective ones of the plurality of pixel points in the initial image includes: receiving a color dispersion degree input based on a target account; obtaining original color values corresponding to respective ones of the plurality of pixel points; adjusting the original color values corresponding to respective ones of the plurality of pixel points based on the color dispersion degree to obtain the initial color values corresponding to respective ones of the plurality of pixel points.

3. The method according to claim 1, wherein The calculating the target color gradient values corresponding to respective ones of the plurality of pixel points based on the initial color values corresponding to respective ones of the plurality of pixel points includes: establishing a two-dimensional coordinate system based on the initial image; determining first color gradient values corresponding to respective ones of the plurality of pixel points based on the initial color values of adjacent pixel points of the plurality of pixel points in the x-axis direction in the two-dimensional coordinate system; determining second color gradient values corresponding to respective ones of the plurality of pixel points based on the initial color values of adjacent pixel points of the plurality of pixel points in the y-axis direction in the two-dimensional coordinate system; determining the target color gradient values corresponding to respective ones of the plurality of pixel points based on the first color gradient values and the second color gradient values corresponding to respective ones of the plurality of pixel points.

4. The method according to claim 1, wherein The adjusting the initial color values corresponding to respective ones of the plurality of pixel points based on a preset smoothing function and the target color gradient values corresponding to respective ones of the plurality of pixel points to obtain the first color values corresponding to respective ones of the plurality of pixel points includes: determining pixel points among the plurality of pixel points whose target color gradient values exceed a preset threshold as edge pixel points; adjusting the initial color values corresponding to the edge pixel points based on the smoothing function to obtain the first color values corresponding to the edge pixel points.

5. The method according to claim 1, characterized in that The adjusting the first color values corresponding to respective ones of the plurality of pixel points based on a preset Gaussian function and the first color values corresponding to adjacent pixel points corresponding to respective ones of the plurality of pixel points to obtain the second color values corresponding to respective ones of the plurality of pixel points includes: determining a Gaussian weight matrix based on the Gaussian function; determining adjacent pixel points corresponding to respective ones of the plurality of pixel points based on a preset color influence range; calculating weighted average color values of the adjacent pixel points corresponding to respective ones of the plurality of pixel points based on the Gaussian weight matrix; Adjust the first color value corresponding to each of the multiple pixel points based on the weighted average color values of the adjacent pixel points corresponding to each of the multiple pixel points, to obtain the second color value corresponding to each of the multiple pixel points.

6. The method according to any one of claims 1 to 5, characterized in that The adjusting the initial image based on the second color value corresponding to each of the multiple pixel points to obtain a target image includes: Randomly generate noise values for the multiple pixel points; Determine the color influence value corresponding to each of the multiple pixel points based on the noise value corresponding to each of the multiple pixel points, wherein the color influence value characterizes the rough feeling of a real pencil; Adjust the initial image based on the second color value corresponding to each of the multiple pixel points and the color influence value corresponding to each of the multiple pixel points, to obtain the target image.

7. An image processing apparatus, characterized in that, It includes: An acquisition module, configured to acquire an initial image; A determination module, configured to determine the initial color value corresponding to each of the multiple pixel points in the initial image; A calculation module, configured to calculate the target color gradient value corresponding to each of the multiple pixel points based on the initial color value corresponding to each of the multiple pixel points; A first adjustment module, configured to adjust the initial color value corresponding to each of the multiple pixel points based on a preset smoothing function and the target color gradient value corresponding to each of the multiple pixel points, to obtain the first color value corresponding to each of the multiple pixel points; A second adjustment module, configured to adjust the first color value corresponding to each of the multiple pixel points based on a preset Gaussian function and the first color value corresponding to the adjacent pixel points corresponding to each of the multiple pixel points, to obtain the second color value corresponding to each of the multiple pixel points; A third adjustment module, configured to adjust the initial image based on the second color value corresponding to each of the multiple pixel points, to obtain a target image, wherein the target image is the initial image in a simulated colored pencil style.

8. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored program, wherein when the program runs, it controls the device where the non-volatile storage medium is located to execute the image processing method according to any one of claims 1 to 6.

9. A computer device, characterized in that, It includes: A memory and a processor, The memory stores a computer program; The processor is configured to execute the computer program stored in the memory, and when the computer program runs, it causes the processor to execute the image processing method according to any one of claims 1 to 6.

10. A computer program product comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the image processing method according to any one of claims 1 to 6.