Stroke generation method, readable storage medium, electronic device, and program product
By combining user-selected colors with brush stamp colors in the painting application, a variety of colored ink marks are generated, solving the problem of poor painting experience caused by preset brush stamps in existing technologies and improving the user's personalized painting experience.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2025-09-05
- Publication Date
- 2026-05-21
AI Technical Summary
In existing painting applications, brush stamps are usually preset, which cannot meet users' personalized painting needs, resulting in a poor painting experience.
By detecting the user's selected first brush and drawing operation, the system generates and displays the ink marks corresponding to the drawing operation. Using color fusion technology, the first color is blended with the pixel colors in the color stamp of the first brush to generate a second color stamp that is different from the original color. The system then repeats the drawing along the drawing trajectory to generate diverse color ink marks.
It enables the generation of diverse colored ink marks based on user needs, meeting personalized painting requirements and enhancing the user's painting experience.
Smart Images

Figure CN2025119427_21052026_PF_FP_ABST
Abstract
Description
Ink generation methods, readable storage media, electronic devices and application products
[0001] This application claims priority to Chinese Patent Application No. 202411625494.2, filed on November 13, 2024, entitled "Ink Generation Method, Readable Storage Medium, Electronic Device and Program Product", and to Chinese Patent Application No. 202411698538.4, filed on November 25, 2024, both of which are incorporated herein by reference in their entirety. Technical Field
[0002] This application relates to the field of terminal technology, and in particular to an ink generation method, a readable storage medium, an electronic device, and a program product. Background Technology
[0003] With the development of touch technology, more and more drawing applications (hereinafter referred to as drawing applications) can generate ink marks along the trajectory drawn by the user on the touch screen of the electronic device using their finger, stylus, etc., thereby enabling the user to draw on the electronic device.
[0004] However, the brush stamps (a stamp refers to the brush pattern, also known as a brush image, brush tip shape, brush shape, etc.) in painting applications are usually preset. Electronic devices can only repeat the preset stamps along the user's drawing path to generate ink marks, which cannot meet the user's personalized painting needs. Summary of the Invention
[0005] In view of this, this application provides an ink generation method, a readable storage medium, an electronic device, and a program product, which are beneficial to improving the user's painting experience.
[0006] In a first aspect, an ink mark generation method is provided, applied to an electronic device. The method includes: detecting that a user selects a first brush, wherein the stamp of the first brush includes a first colored stamp; in response to a user's drawing operation, generating and displaying an ink mark corresponding to the drawing operation, wherein the ink mark includes at least one second colored stamp repeatedly drawn along a drawing trajectory corresponding to the drawing operation, the second colored stamp being obtained by fusing a first color with the colors of each pixel in the first colored stamp; wherein the first color is a color selected by the user, or a color determined by the electronic device based on the color selected by the user, or a color randomly determined by the electronic device, or a color determined by the electronic device based on the stylus parameters of a stylus pen used to draw the aforementioned drawing trajectory, the stylus parameters including one or more of stylus pressure, stylus angle, and stylus tilt angle.
[0007] In this method, upon detecting a user's drawing operation using a first brush, the electronic device can fuse a first color with pixels from a first color stamp in the first brush (e.g., a colored brush) to obtain a second color stamp. Furthermore, the electronic device can repeatedly draw along the user's drawn path using at least one second color stamp to obtain colored ink. In other words, the color of the color stamp (second color stamp) included in the colored ink produced by the electronic device is different from the color of the original color stamp (first color stamp) included in the first brush. Thus, the electronic device can generate different colored ink based on different first colors, satisfying the user's personalized needs.
[0008] In some implementations, color fusion of the first color with the pixels in the first color stamp refers to fusion of at least some of the three color elements (e.g., hue, saturation, and lightness) of the first color with at least some of the three color elements of the pixels in the first color stamp. Alternatively, it can refer to fusion of at least some color attributes of the first color in the color model with at least some color attributes of the first color stamp.
[0009] In one possible implementation of the first aspect described above, the ink mark further includes at least one third color stamp repeatedly drawn along the drawing trajectory, the third color stamp being obtained by blending the second color with the colors of each pixel in the first color stamp.
[0010] In this implementation, the colored ink generated by the electronic device can include multiple colors (a first color and a second color) that are combined with each pixel in the first colored stamp to obtain multiple different blended colored stamps (a second colored stamp and a third colored stamp). In other words, when a user draws a drawing trajectory, the electronic device can generate colored ink that includes multiple different blended colored stamps, which helps to improve the user's drawing experience.
[0011] In some implementations, the second color is a color selected by the user, or a color determined by the electronic device based on the color selected by the user, or a color randomly determined by the electronic device, or a color determined by the electronic device based on the stylus parameters of the stylus used to draw the above-mentioned drawing trajectory.
[0012] In one possible implementation of the first aspect above, the ink mark includes a plurality of second color stamps, at least some of the second color stamps having different stamp parameters; and / or, the ink mark includes a plurality of third color stamps, at least some of the third color stamps having different stamp parameters; wherein the stamp parameters include at least one of the following parameters: stamp size, stamp orientation, stamp opacity, stamp roundness, and stamp spacing.
[0013] In this implementation, the size, orientation, opacity, roundness, and spacing of the multiple second-color stamps included in the colored ink can differ, and / or the size, orientation, opacity, roundness, and spacing of the multiple third-color stamps included in the colored ink can also differ. This increases the diversity of the generated colored ink and meets the user's personalized drawing needs.
[0014] In one possible implementation of the first aspect above, at least some of the stamp parameters of the plurality of second color stamps are randomly determined by the electronic device, or determined by the electronic device based on at least one stylus parameter; and / or, at least some of the stamp parameters of the plurality of third color stamps are randomly determined by the electronic device, or determined by the electronic device based on at least one stylus parameter.
[0015] In this implementation, the size, orientation, opacity, roundness, and spacing of the second or third color stamp can be randomly adjusted by the electronic device or adjusted based on the stylus parameters. Thus, the user can control the electronic device to generate different ink strokes by adjusting the stylus parameters during the drawing process.
[0016] In one possible implementation of the first aspect above, the first brush is generated by detecting a user's operation of configuring the first brush based on a first color image, and configuring at least a portion of the image area in the first color image as a first color stamp.
[0017] In this implementation, the electronic device can configure part or all of the area of the first color image selected by the user as the first color stamp of the first brush. In other words, the user can configure the color image as a color stamp according to their own drawing needs. This satisfies the user's personalized drawing needs and improves the user experience.
[0018] In one possible implementation of the first aspect above, the color of the first pixel in the first color stamp is the third color, and the color of the second pixel corresponding to the first pixel in the second color stamp is the fourth color, wherein the hue of the fourth color is the same as the hue of the first color, the saturation of the fourth color is obtained based on the saturation of the first color and / or the saturation of the third color, and the brightness of the fourth color is obtained based on the brightness of the first color and / or the brightness of the third color.
[0019] In one possible implementation of the first aspect above, the saturation of the fourth color is obtained based on the saturation of the first color and / or the saturation of the third color, including: the saturation of the fourth color is the saturation of the first color; or the saturation of the fourth color is the product of the saturation of the first color and a first value; or the saturation of the fourth color is the sum of the saturation of the first color and the first saturation; or the saturation of the fourth color is the saturation of the third color; or the saturation of the fourth color is the product of the saturation of the third color and a second value; or the saturation of the fourth color is the sum of the saturation of the third color and the second saturation; or the saturation of the fourth color is the weighted sum of the saturation of the first color and the saturation of the third color; or the saturation of the fourth color is the product of the saturation of the first color and the saturation of the third color.
[0020] In this implementation, the hue of each pixel in the second color stamp is the hue of the first color, thus recoloring the first color stamp. Furthermore, since the saturation (and / or brightness) of each pixel in the second color stamp is obtained by fusing the saturation (and / or brightness) of each pixel in the first color stamp with the saturation (and / or brightness) of the first color stamp, more texture information from the first color stamp can be preserved.
[0021] In one possible implementation of the first aspect above, the brightness of the fourth color is obtained based on the brightness of the first color and / or the brightness of the third color, including: the brightness of the fourth color is the brightness of the first color; or the brightness of the fourth color is the product of the brightness of the first color and a third value; or the brightness of the fourth color is the sum of the brightness of the first color and the first value; the brightness of the fourth color is the brightness of the third color; or the brightness of the fourth color is the product of the brightness of the third color and a fourth value; or the brightness of the fourth color is the sum of the brightness of the third color and a second value; or the brightness of the fourth color is a weighted sum of the brightness of the first color and the brightness of the third color. Alternatively, the brightness of the fourth color is the product of the brightness of the first color and the brightness of the third color; or, if the brightness of the first color is less than the brightness threshold, the brightness of the fourth color is twice the product of the brightness of the first color and the brightness of the third color; if the brightness of the first color is greater than or equal to the brightness threshold, the brightness of the fourth color is 1 - 2 × (1 - brightness of the first color) × (1 - brightness of the third color); wherein, if the brightness of the fourth color is the same as the brightness of the first color, the saturation of the fourth color is not the same as the saturation of the first color; and if the brightness of the fourth color is the same as the brightness of the third color, the saturation of the fourth color is not the same as the saturation of the third color.
[0022] In one possible implementation of the first aspect above, the color of the first pixel in the first color stamp is the third color, and the color of the second pixel corresponding to the first pixel in the second color stamp is the fourth color; and the fourth color is obtained by scaling the pixel value of the intermediate color obtained by fusing the first color and the third color in the RGB color model based on a scaling factor, wherein the hue of the intermediate color is the same as the hue of the first color, the saturation of the intermediate color is obtained based on the saturation of the first color and / or the saturation of the third color, the brightness of the intermediate color is obtained based on the brightness of the first color and / or the brightness of the third color, and the scaling factor is obtained based on the brightness of the first color in the HSV color model.
[0023] In some implementations, the pixel value of an intermediate color in the RGB color model is obtained by converting the hue, saturation, and lightness of the intermediate color in the HSY color model to the RGB color model. Alternatively, the pixel value of an intermediate color in the RGB color model can also be obtained by converting the representation of the intermediate color in other color models to the RGB color model.
[0024] In one possible implementation of the first aspect above, the saturation of the intermediate color is obtained based on the saturation of the first color and / or the saturation of the third color, including: the saturation of the intermediate color is the saturation of the first color; or the saturation of the intermediate color is the product of the saturation of the first color and a first value; or the saturation of the intermediate color is the sum of the saturation of the first color and the first saturation; or the saturation of the intermediate color is the saturation of the third color; or the saturation of the intermediate color is the product of the saturation of the third color and a second value; or the saturation of the intermediate color is the sum of the saturation of the third color and the second saturation; or the saturation of the intermediate color is the weighted sum of the saturation of the first color and the saturation of the third color; or the saturation of the intermediate color is the product of the saturation of the first color and the saturation of the third color.
[0025] In one possible implementation of the first aspect above, the brightness of the intermediate color is obtained based on the brightness of the first color and / or the brightness of the third color, including: the brightness of the intermediate color is the brightness of the first color; or the brightness of the intermediate color is the product of the brightness of the first color and a third value; or the brightness of the intermediate color is the sum of the brightness of the first color and the first value; the brightness of the intermediate color is the brightness of the third color; or the brightness of the intermediate color is the product of the brightness of the third color and a fourth value; or the brightness of the intermediate color is the sum of the brightness of the third color and a second value; or the brightness of the intermediate color is a weighted sum of the brightness of the first color and the brightness of the third color. Alternatively, the brightness of the intermediate color is the product of the brightness of the first color and the brightness of the third color; or, if the brightness of the first color is less than the brightness threshold, the brightness of the intermediate color is twice the product of the brightness of the first color and the brightness of the third color; if the brightness of the first color is greater than or equal to the brightness threshold, the brightness of the intermediate color is 1 - 2 × (1 - brightness of the first color) × (1 - brightness of the third color); wherein, if the brightness of the intermediate color is the same as the brightness of the first color, the saturation of the intermediate color is not the same as the saturation of the first color; and if the brightness of the intermediate color is the same as the brightness of the third color, the saturation of the intermediate color is not the same as the saturation of the third color.
[0026] In one possible implementation of the first aspect above, the scaling factor is: the sum of the product of the first value and the brightness of the first color in the HSV color model and the second value, wherein the sum of the first value and the second value is 1, and the first value and the second value are greater than or equal to 0.
[0027] In this implementation, the scaling factor can be V (hereinafter referred to as V), with the first value being e1 (hereinafter referred to as e1) and the second value being e2 (hereinafter referred to as e2).
[0028] In one possible implementation of the first aspect described above, the stamp of the first brush further includes a fourth color stamp; the ink also includes at least one fifth color stamp repeatedly drawn along the drawing trajectory, the fifth color stamp being obtained by blending the fifth color with the colors of each pixel in the fourth color stamp.
[0029] In this implementation, the first brush can be configured with multiple brushes (i.e., including multiple color stamps: a first color stamp and a fourth color stamp). The electronic device can blend the same or different colors with the color stamps corresponding to each brush, and then repeatedly draw along the drawing trajectory using the blended color stamps (the second color stamp, the fifth color stamp) to obtain colored ink marks. Based on this, the diversity of colored ink marks generated by the electronic device can be increased.
[0030] In some implementations, there may be one or more fourth color stamps.
[0031] In some implementations, the fifth color can be the same as or different from the first color.
[0032] In one possible implementation of the first aspect described above, the ink mark further includes at least one sixth color stamp that is repeatedly drawn along the drawing trajectory, the sixth color stamp being obtained by fusing the colors of the sixth color with the colors of the pixels in the fourth color stamp.
[0033] In this implementation, for the fourth color stamp, the electronic device can also fuse multiple colors with the fourth color stamp to obtain multiple color stamps (a fifth color stamp, a sixth color stamp), and repeatedly draw these multiple color stamps along the drawing trajectory. Based on this, the diversity of color ink marks generated by the electronic device can be increased.
[0034] In some implementations, the sixth color is a color selected by the user, or a color determined by the electronic device based on the color selected by the user, or a color randomly determined by the electronic device, or a color determined by the electronic device based on the stylus parameters of the stylus used to draw the above-mentioned drawing trajectory.
[0035] In one possible implementation of the first aspect above, the overlapping area of the second and fifth color stamps in the ink is obtained based on a first color mixing mode, wherein the first color mixing mode is a color mixing mode selected by the user from at least one color mixing mode, or a color mixing mode determined by the electronic device from at least one color mixing mode.
[0036] In this implementation, for the overlapping areas of the merged color stamps (second color stamp, fifth color stamp) corresponding to different color stamps in different colored ink marks, the electronic device can perform color mixing based on any one of the multiple color mixing modes, namely, the first color mixing mode. The first color mixing mode can be selected by the user or automatically selected by the electronic device. In this way, the user can adjust the effect of the overlapping area of the second color stamp and the fifth color stamp in the ink mark generated by the electronic device by selecting different color mixing modes.
[0037] In one possible implementation of the first aspect above, the at least one color mixing mode includes one or more of the following color mixing modes: normal color mixing mode, multiply color mixing mode, darken color mixing mode, color burn color mixing mode, linear burn color mixing mode, color dodge color mixing mode, difference color mixing mode, subtract color mixing mode, cover color mixing mode, dissolve color mixing mode, dark color mixing mode, lighten color mixing mode, screen color mixing mode, linear dodge color mixing mode, light color mixing mode, soft light color mixing mode, hard light color mixing mode, bright light color mixing mode, linear light color mixing mode, point light color mixing mode, solid color mixing mode, exclusion color mixing mode, divide color mixing mode, hue color mixing mode, saturation color mixing mode, color mixing mode, and lightness color mixing mode.
[0038] In one possible implementation of the first aspect described above, the first color stamp is a color stamp obtained by fusing the seventh color stamp with the first texture.
[0039] In this implementation, the electronic device can fuse the first brush stamp with a texture (e.g., texture W1 below) to obtain a colored stamp (e.g., colored stamp CB3 below) and then fuse it with a first color to obtain a second colored stamp. The second colored stamp is then repeatedly drawn along the drawing trajectory to obtain colored ink marks. In other words, the electronic device can also overlay different textures onto the colored stamp of the brush to generate different colored stamps, increasing the diversity of colored stamps and improving the user experience.
[0040] In some implementations, the blending of the first and seventh color stamps can be based on any of the following blending modes: Normal blending mode, Multiply blending mode, Darken blending mode, Color Burn blending mode, Linear Burn blending mode, Color Dodge blending mode, Difference blending mode, Subtract blending mode, Overlay blending mode, Dissolve blending mode, Darken blending mode, Lighten blending mode, Screen blending mode, Linear Dodge blending mode, Lighten blending mode, Soft Light blending mode, Hard Light blending mode, Bright Light blending mode, Linear Light blending mode, Point Light blending mode, Solid Color Blend blending mode, Exclusion blending mode, Divide blending mode, Hue blending mode, Saturation blending mode, Color blending mode, and Lightness blending mode.
[0041] In a second aspect, an electronic device is provided, comprising: a memory for storing one or more programs; and a processor for executing the one or more programs to cause the electronic device to implement the ink generation method provided in the first aspect and any possible implementation of the first aspect.
[0042] Thirdly, a readable storage medium is provided, which includes one or more programs that, when executed on an electronic device, cause the electronic device to implement the first aspect and any possible implementation of the ink generation method provided by the first aspect.
[0043] Fourthly, a program product is provided that, when run on an electronic device, enables the electronic device to implement the first aspect and any possible implementation of any ink generation method provided in the first aspect.
[0044] It should be understood that the beneficial effects of the second to fourth aspects mentioned above can be referred to the beneficial effects described in the first aspect, and will not be repeated here. Attached Figure Description
[0045] Figure 1 illustrates a schematic diagram of recoloring a grayscale stamp corresponding to a color image, according to some embodiments of this application.
[0046] Figure 2A illustrates, according to some embodiments of this application, a schematic diagram of processing a color image into a color stamp and then repeatedly drawing the color stamp along a user-drawn trajectory to generate color ink marks.
[0047] Figure 2B illustrates a schematic diagram of generating colored ink based on a colored stamp, according to some embodiments of this application.
[0048] Figure 3A shows a schematic diagram of fusing a first color with a color stamp CB1 to obtain a fused color stamp CB1' according to some embodiments of this application.
[0049] Figure 3B illustrates a schematic diagram of generating color ink based on a fused color stamp CB1' according to some embodiments of this application.
[0050] Figure 3C shows a schematic diagram of fusing a second color with a color stamp CB1 to obtain a fused color stamp CB1″ according to some embodiments of this application.
[0051] Figure 3D illustrates a schematic diagram of generating colored ink based on a fused color stamp CB1″ according to some embodiments of this application.
[0052] Figure 4A shows a schematic diagram of fusing a fifth color with a color stamp CB2 to obtain a fused color stamp CB2', according to some embodiments of this application.
[0053] Figure 4B illustrates a schematic diagram of generating colored ink based on fused color stamps CB1' and fused color stamps CB2', according to some embodiments of this application.
[0054] Figure 4C illustrates a schematic diagram of generating colored ink based on fused color stamps CB1', fused color stamps CB1″ and fused color stamps CB2', according to some embodiments of this application.
[0055] Figure 5A illustrates a schematic diagram of an interface for line options according to some embodiments of this application.
[0056] Figure 5B illustrates a schematic diagram of color ink comparison based on a color stamp CB1 when the stamp spacing is different, according to some embodiments of this application.
[0057] Figure 5C illustrates a schematic diagram of color ink comparison based on a color stamp CB1 when the stamp size is different, according to some embodiments of this application.
[0058] Figure 5D illustrates a schematic diagram of a comparison of color ink marks generated based on a color stamp CB1 when the size jitter values are different, according to some embodiments of this application.
[0059] Figure 5E illustrates a schematic diagram of a comparison of color ink marks generated based on a color stamp CB1 when the opacity jitter stamp value is different, according to some embodiments of this application.
[0060] Figure 6A illustrates a schematic diagram of an interface for shape options according to some embodiments of this application.
[0061] Figure 6B illustrates a schematic diagram of a comparison of color ink marks generated based on a color stamp CB1 when the stamp scattering values are different, according to some embodiments of this application.
[0062] Figure 6C illustrates a schematic diagram of color ink comparison based on a color stamp CB1 when the stamp angle is different, according to some embodiments of this application.
[0063] Figure 6D illustrates a schematic diagram of how the roundness of a stamp varies with stylus parameters, according to some embodiments of this application.
[0064] Figure 7A shows a schematic diagram of an interface for a color dynamic option according to some embodiments of this application.
[0065] Figure 7B, according to some embodiments of this application, shows a comparative schematic diagram of the blended color and blended color stamp of a color stamp CB1 when the hue dithering values are different in color dithering.
[0066] Figure 7C, according to some embodiments of this application, shows a comparative schematic diagram of the blended color and blended color stamp of a color stamp CB1 when the saturation jitter values are different in color jitter.
[0067] Figure 7D, according to some embodiments of this application, shows a comparative schematic diagram of the blended color and blended color stamp of a color stamp CB1 when the brightness jitter values are different in color jitter.
[0068] Figure 7E, according to some embodiments of this application, shows a schematic diagram of the blended color of a color stamp CB1 when the hue value in the pressure color is not 0 and the change of the blended color stamp with the pressure of the stylus.
[0069] Figure 7F, according to some embodiments of this application, shows a schematic diagram of the blended color of a color stamp CB1 when the saturation value in the tilt color is not 0 and the change of the blended color stamp with the tilt angle of the stylus.
[0070] Figure 7G, according to some embodiments of this application, shows a schematic diagram of the blended color of a color stamp CB1 when the hue and saturation values in the corner color are not 0, and the change of the blended color stamp with the corner of the stylus.
[0071] Figure 8A shows a schematic diagram of an interface for a stylus option according to some embodiments of this application.
[0072] Figure 8B illustrates a schematic diagram of generating colored ink based on a textured colored stamp, according to some embodiments of this application.
[0073] Figure 9 illustrates a schematic diagram of configuring multiple brushes for brush B1 according to some embodiments of this application.
[0074] Figure 10 illustrates a flowchart of an ink generation method according to some embodiments of this application.
[0075] Figure 11A shows a schematic diagram of a color ink stain IK7 according to some embodiments of this application.
[0076] Figure 11B shows a schematic diagram of a color ink stain IK7-1 according to some embodiments of this application.
[0077] Figure 11C shows a schematic diagram of a color ink stain IK7-2 according to some embodiments of this application.
[0078] Figure 12 illustrates a schematic diagram of a software architecture according to some embodiments of this application.
[0079] Figure 13 illustrates an interactive flow diagram of an ink generation method according to some embodiments of this application.
[0080] Figure 14 shows a schematic diagram of the structure of an electronic device according to some embodiments of this application.
[0081] Figure 15 shows a schematic diagram of the structure of a stylus according to some embodiments of this application. Detailed Implementation
[0082] The illustrative embodiments of this application include, but are not limited to, ink generation methods, readable storage media, electronic devices, and program products.
[0083] For the purposes of this description, we will first introduce the terminology used in this application.
[0084] (1) The three elements of color
[0085] A color can be represented by three parameters: hue, saturation, and value. Different hues, saturations, or values will represent different colors. Hue, saturation, and value can be called the three elements of color.
[0086] Hue is used to indicate the color gradation, such as red, yellow, green, blue, and black; saturation (also called purity) is used to indicate the purity of a color; and lightness / brightness is used to indicate the lightness or darkness of a color. Visually, different saturations and / or lightness / brightness result in different shades of color.
[0087] (2) Color Model
[0088] A color model (or color space) is an abstract mathematical model that uses multiple color attributes to represent colors.
[0089] For example, the Red-Green-Blue color model (RGB model) represents color using three color attributes: red, green, and blue. The Red-Green-Blue-Transparency color model (RGBA model) represents color using three color attributes: red, green, and blue, and uses transparency to represent the transparency when a color is overlaid on top of other colors. The Hue-Saturation-Lightness color model (HSV model) represents color using three color attributes: hue, saturation, and lightness. The Hue-Saturation-Brightness color model (HSB model) represents color using three color attributes: hue, saturation, and lightness. The Hue-Saturation-Lightness (or Brightness) color model (HSY model) represents color using three color attributes: hue, saturation, and lightness.
[0090] It should be noted that the same color attributes (such as hue, saturation, and lightness) can be calculated in the same or different ways in different color models. The specific calculation method depends on the definition of each color model and will not be elaborated here. For example, in the HSV and HSY color models, hue is calculated in the same way, but saturation and lightness are calculated differently.
[0091] It should be noted that the color attributes used to represent colors in different color models can all be converted into the three elements of color, and different color models can also be converted into each other.
[0092] The technical solution of this application is described below with reference to the accompanying drawings.
[0093] To meet users' personalized needs, in some embodiments of this application, the painting application can process the color image selected by the user into a grayscale stamp, recolor the grayscale stamp based on the brush color selected by the user, and repeatedly draw the recoloring color stamp along the trajectory drawn by the user to generate ink marks.
[0094] However, grayscale stamps typically record less texture information. For example, a grayscale stamp usually only records information from the alpha channel (such as transparency), but not color information such as hue, saturation, and brightness. Since changes in saturation and brightness in a color image reflect changes in color depth, and hue reflects changes in color shade (visually reflecting changes in texture in a color image), converting a color image to a grayscale stamp results in the loss of texture changes reflected in saturation and brightness, as well as the loss of the true colors of the color image reflected in hue.
[0095] When electronic devices recolor a grayscale stamp based on a user-selected color (hereinafter referred to as the drawing color), they typically use the hue and lightness of the drawing color as the hue and lightness of each pixel in the recolored color stamp, and the opacity of each pixel recorded in the grayscale stamp as the saturation of the corresponding pixel in the recolored color stamp. Thus, although a grayscale stamp can be converted to a color stamp through recoloring, it still cannot reproduce the texture reflected by changes in saturation and lightness in a color image, nor can it reproduce the true colors reflected by changes in hue in a color image.
[0096] For example, referring to Figure 1, the electronic device can process a color image I1 into a grayscale stamp. The grayscale stamp includes the transparency information of each pixel but does not include color information such as hue, saturation, and brightness. In the color stamp obtained by recoloring the grayscale stamp by the electronic device, the shape of the leaves in the color image I1 is restored, but some texture is lost (visually, some leaf veins are not visible, and the light and dark changes of the leaves are weakened).
[0097] To address the issue that recoloring a grayscale stamp cannot reproduce the color and texture of a user-selected color image, in some embodiments of this application, the electronic device can directly process the user-selected color image into a color stamp (hereinafter, a brush with a color pattern as a stamp is referred to as a color brush). After detecting the user's operation of drawing ink marks with a color brush, the electronic device can directly repeat the drawing of the color stamp corresponding to the color brush along the user's drawing path to obtain ink marks. In this way, since the color stamp retains color information such as hue, saturation, and brightness in the user-selected color image, the ink marks obtained by repeatedly drawing with a color stamp can reproduce the color and texture of the user-selected color image more accurately.
[0098] For example, Figure 2A, according to some embodiments of this application, shows a schematic diagram of processing a color image into a color stamp and then repeatedly drawing the color stamp along a user-drawn trajectory to generate color ink marks.
[0099] As shown in Figure 2A, the drawing interface P1 of the drawing application displayed on the electronic device includes a brush control U11 and a color control U12 (used to configure drawing colors). In response to the user clicking the brush control U11, the electronic device can display a brush library control U13, which includes brushes configured in the electronic device (e.g., brush B1) and a new brush control U131 (used to add new brushes).
[0100] The electronic device can respond to the user's double-click operation of brush B1 by displaying the brush editing interface P2. The brush editing interface P2 includes options for editing brush parameters (such as shape, texture, color, spacing, size, direction, and changes in form following the stylus) (e.g., shape options, texture options, rendering options, color dynamic options, multi-brush options, stylus options, etc., which will be described in detail later) and a brush preview window U14. Among them, the shape options include controls for editing functions such as brush stamping, scattering, rotation, randomization, and following the pen tip rotation (e.g., editing control U15 for editing the brush stamp).
[0101] The electronic device can respond to the user's click on the editing control U15 and display the editing stamp control U16 in the interface P3. The editing stamp control U16 includes a stamp preview box U161, a selection control U162 for stamps stored in the electronic device, an add control U163, a cancel control U165, and an confirm control U164.
[0102] The electronic device can respond to the user's click on the add control U163 and display the image selection interface P4, which includes the image stored in the electronic device (such as color image I1, color image I2, etc.) and the confirm control U17.
[0103] The electronic device can process the color image I1 into a color stamp CB1 and display a preview image of the color stamp CB1 in the stamp editing control U18 of the interface P5 in response to the user's selection of the color image I1 and clicking the OK control U17.
[0104] The electronic device can respond to the user's click on the "Confirm" option of the edit stamp control U18, configuring the color stamp CB1 as the stamp of brush B1 and displaying the brush editing interface P6. Compared to the brush editing interface P2, the stamp in the brush editing interface P6 is updated to the color stamp CB1, and a new color control U20 is added (used to select either the color stamp CB1 or the grayscale stamp corresponding to the color stamp CB1 as the stamp of brush B1).
[0105] The electronic device can configure the color stamp CB1 as the stamp of brush B1 in response to the user's selection of the confirmation control U19 in the brush editing interface P6.
[0106] Referring to Figure 2B, after configuring the color stamp CB1 as the stamp of brush B1, the electronic device can display the drawing interface P7. In the drawing interface P7, the preview image of brush B1 is updated to the preview image of the aforementioned color stamp CB1. In this case, brush B1 can be a color brush. Then, referring to the interface P8 in Figure 2B, the electronic device can respond to the user's operation of drawing trajectory L1 through brush B1, and directly repeat the drawing of the color stamp CB1 along trajectory L1 to obtain the color ink mark IK1.
[0107] However, when ink is created by directly repeating the same strokes of a colored brush along the user's lines, the color of each stamp remains fixed. Even if the user selects different colors, the electronic device will still repeat the same strokes using the same stamps. This fails to meet the user's personalized drawing needs (such as the need to create colored ink with different colored stamps). For example, if the color image is of green leaves, the leaves in the resulting colored brush stamps will also be green, and the leaves in the generated colored ink will also be green. The user cannot use this colored brush to draw yellow leaves.
[0108] It should be noted that in the accompanying drawings of the embodiments of this application, a colored ink mark represents a colored ink mark rather than the grayscale ink mark presented in the accompanying drawings, a colored image represents a colored image rather than the grayscale image presented in the accompanying drawings, and a colored stamp represents a colored stamp rather than the grayscale stamp presented in the accompanying drawings.
[0109] In view of this, this application provides an ink mark generation method. Based on the above-mentioned colored brush, after the electronic device detects the user's operation of drawing ink marks with the colored brush, it can fuse the first color (such as the drawing color selected by the user, or the color randomly generated by the electronic device) with the color of each pixel in the first colored stamp of the colored brush to obtain a second colored stamp with a different color from the first colored stamp. At least one second colored stamp is repeatedly drawn along the drawing trajectory drawn by the user (such as the trajectory of the user's finger or stylus sliding on the electronic device display screen) to obtain colored ink marks.
[0110] Based on this, the electronic device can fuse the first color with the first color stamp to obtain a second color stamp with a different color than the first color stamp, thereby generating colored ink marks that include color stamps of different colors, which can meet the user's personalized needs. Furthermore, since the electronic device obtains the second color stamp by fusing the first color and the first color stamp in this method, rather than recoloring a grayscale stamp to generate a colored stamp, it can retain as much of the texture in the first color stamp (or the color image that generates the first color stamp) as possible, which is beneficial to improving the user's drawing experience.
[0111] For ease of description, the color that is blended with the color stamp in the colored brush (e.g., the first brush, brush CB1) will be referred to as the blend color (e.g., the first color), and the color stamp obtained by blending the blend color with the color stamp in the colored brush will be referred to as the blended color stamp. The blend color can be a color selected by the user or a color determined by the electronic device.
[0112] For example, referring to FIG3A, when the leaves in the first color stamp (e.g., the aforementioned color stamp CB1) are green, and the hue of the first color is 0° (corresponding to red), the saturation is 81%, and the brightness is 100%, the electronic device can blend the first color with the colors of each pixel in the color stamp CB1 to obtain a blended color stamp CB1', so that the leaves in the blended color stamp CB1' are red. For example, if the hue of the color of pixel PX1 in the color stamp CB1 is 132° (corresponding to green), the saturation is 99%, and the brightness is 60% (corresponding to green), the electronic device can blend the first color with the color of pixel PX1 to obtain the color of the corresponding pixel PX2 in the blended color stamp CB1'. As shown in FIG3A, the hue of the color of pixel PX2 is the hue (0°) of the first color, the saturation of the color of pixel PX2 is the saturation (81%) of the first color, and the brightness of the color of pixel PX2 is the brightness (60%) of pixel PX1. Referring to Figure 3B, the electronic device can respond to the user's operation of drawing the aforementioned trajectory L1 using brush B1, and repeatedly draw the fused color stamp CB1' shown in Figure 3A along trajectory L1 to obtain a colored ink mark IK2. The color of the fused color stamp CB1' in colored ink mark IK2 is different from the color of the stamp in colored ink mark IK1.
[0113] In some embodiments, the electronic device may also blend multiple colors with each pixel of a color stamp in a color brush to obtain multiple blended color stamps with colors different from the colors of the color stamps in the color brush. Then, these blended color stamps are repeatedly drawn along the user's drawing path to obtain colored ink. For example, the electronic device may blend a second color (a user-selected drawing color or a color randomly generated by the electronic device) with each pixel of a first color stamp to obtain a third color stamp. The third color stamp and the second color stamp are then repeatedly drawn along the drawing path to obtain colored ink.
[0114] For example, referring to Figure 3C, with the first color stamp being the aforementioned color stamp CB1, and the second color having a hue of 306°, a saturation of 99%, and a brightness of 50% (corresponding to a deep purple color), the electronic device can blend the second color with the colors of each pixel in the color stamp CB1 to obtain a blended color stamp CB1″ (as a third color stamp), so that the leaves in the blended color stamp CB1″ are deep purple. For example, the hue of pixel PX1 in color stamp CB1 is 132° (corresponding to green), saturation is 99%, and lightness is 60% (corresponding to green). The electronic device can blend the second color with the color of pixel PX1 to obtain the color of pixel PX3 in the blended color stamp CB1″. As shown in Figure 3C, the hue of pixel PX3 is the hue of the second color (306°), the saturation of pixel PX3 is the saturation of the first color (99%), and the lightness of pixel PX2 is the lightness of pixel PX1 (60%). Referring to Figure 3D, the electronic device can respond to the user's operation of drawing the aforementioned trajectory L1 with brush B1, and repeatedly draw the blended color stamp CB1' shown in Figure 3A and the blended color stamp CB1″ shown in Figure 3C along trajectory L1 to obtain the colored ink mark IK3. The colored ink mark IK3 includes the blended color stamp CB1' and the blended color stamp CB1″.
[0115] In some embodiments, during the process of repeatedly drawing multiple fused color stamps of the first color stamp along the trajectory, the drawing frequency, drawing position, drawing spacing, etc. of each fused color stamp can be dynamically changed (e.g., randomly changed). For example, continuing to refer to FIG3D, in the color ink IK3, the spacing between adjacent fused color stamps CB1' among the 5 fused color stamps CB1' is different, the spacing between adjacent fused color stamps CB1″ among the 5 fused color stamps CB1″ is different, and the number of fused color stamps CB1″ drawn between adjacent fused color stamps CB1' is also different.
[0116] In other embodiments, during the repeated drawing of multiple fused color stamps of the first color stamp along the trajectory, the individual fused color stamps can also be drawn alternately and repeatedly in a fixed order and at fixed intervals. For example, in the case where the fused color stamps of color stamp CB1 include fused color stamp CB1' and fused color stamp CB1″, the electronic device can draw k fused color stamps CB1' (k is a positive integer, and the spacing between two adjacent fused color stamps CB1' is the same) on the drawing trajectory, then draw m fused color stamps CB1″ (m is a positive integer, and the spacing between adjacent fused color stamps CB1″ is the same), then draw k fused color stamps CB1' again, and so on.
[0117] It should be noted that in some other embodiments, the above-described ink generation method can also be implemented independently of the color brush. For example, an electronic device can be configured with a brush specifically used to repeatedly draw the stamp after the first color and the color stamp are merged along the drawing trajectory to obtain the color ink. This is not limited here.
[0118] It should be noted that, in some embodiments, when the first color is white (saturation of 0% and brightness of 100%), the electronic device can directly repeat the first color stamp of the color brush along the drawing trajectory.
[0119] It should be noted that when the drawing trajectory is short (e.g., the drawing trajectory is shorter than the stamp spacing of the first color stamp), the first color stamp can be drawn once on the drawing trajectory; when the drawing trajectory is long (e.g., the drawing trajectory is greater than or equal to the stamp spacing of the first color stamp), the first color stamp can be drawn repeatedly on the drawing trajectory.
[0120] In some embodiments, the hue of each pixel in the second color stamp is the same as the hue of the first color, and at least one of the saturation and brightness of each pixel in the second color stamp is different from that of the first color. For example, the saturation of each pixel in the second color stamp can be obtained based on the saturation of the first color and / or the saturation of the corresponding pixel color in the first color stamp, and the brightness of each pixel in the second color stamp can be obtained based on the brightness of the first color and / or the brightness of the corresponding pixel color in the first color stamp.
[0121] The first color and the first colored stamp are merged to generate the second colored stamp. Below are some ways to merge the first color and the first colored stamp.
[0122] Blending Method 1: The hue of each pixel in the second color stamp is the hue of the first color. The saturation of each pixel in the second color stamp is determined based on the saturation of the corresponding pixel in the first color stamp and / or the saturation of the first color. The brightness of each pixel in the second color stamp is determined based on the brightness of the corresponding pixel in the first color stamp and / or the brightness of the first color.
[0123] For example, taking the first pixel in the first color stamp corresponding to the second pixel in the second color stamp, the color of the first pixel being the third color, and the color of the second pixel being the fourth color as an example:
[0124] The hue of the fourth color is the same as the hue of the first color;
[0125] The saturation of the fourth color can be the saturation of the third color, or the product of the saturation of the third color and a preset multiplier, or the sum of the saturation of the third color and a preset saturation, or the product of the sum of the saturation of the third color and a preset saturation multiplier, or the sum of the saturation of the first color and a preset saturation, or the weighted sum of the saturation of the third color and the saturation of the first color, or the product of the saturation of the third color and the saturation of the first color.
[0126] The brightness of the fourth color can be the brightness of the third color, or the product of the brightness of the third color and a preset multiplier, or the sum of the brightness of the third color and a preset brightness, or the product of the third color and a preset brightness multiplier, or the sum of the third color and a preset brightness, or the weighted sum of the brightness of the third color and the brightness of the first color, or the product of the brightness of the third color and the brightness of the first color.
[0127] For example, in the cases shown in Figures 3A and 3B, the hue of the first color is 0°, the saturation is 81%, and the brightness is 100%. The hue of pixel PX1 (as the first pixel) is 132°, the saturation is 99%, and the brightness is 60%. The hue of pixel PX2 (as the second pixel) is 0°. The saturation of pixel PX2 can be 99%, or 99% × a1 (preset multiplier), or 99% + d1 (preset saturation), or 81% × a1 (preset saturation multiplier), or 81% + d2 (preset saturation), or 99% × a2 (weighted coefficient of the first color's saturation) + 81% × a3 (weighted coefficient of the third color's saturation), or 99% × 81%. The brightness of the color of pixel PX2 can be 60%, or 60%×a4 (preset brightness multiplier), or 60%+d3 (preset brightness), or brightness of 100%×a1 (preset multiplier), or 100%+d4 (preset brightness), or 60%×a5 (weighted coefficient of brightness of the first color)+100%×a6 (weighted coefficient of brightness of the third color), or 60%×100%.
[0128] It should be noted that the above method of obtaining the color saturation of the second pixel based on the color saturation of the first pixel and / or the color saturation of the first pixel is only an example. In other embodiments, the electronic device may also obtain the color saturation of the second pixel based on other methods, which are not limited here.
[0129] It should be noted that the above method of obtaining the brightness of the second pixel based on the brightness of the first pixel and / or the brightness of the first color is only an example. In other embodiments, the electronic device may also obtain the brightness of the second pixel based on other methods, which are not limited here.
[0130] It should be noted that if the brightness of the fourth color obtained by the above method exceeds the upper limit of the brightness value range, the brightness of the fourth color can be set to the upper limit of the brightness value range; if the brightness of the fourth color obtained by the above method exceeds the lower limit of the brightness value range, the brightness of the fourth color can be set to the lower limit of the brightness value range.
[0131] It should be noted that if the saturation of the fourth color obtained by the above method exceeds the upper limit of the saturation value range, the saturation of the fourth color can be set to the upper limit of the saturation value range; if the saturation of the fourth color obtained by the above method exceeds the lower limit of the saturation value range, the saturation of the fourth color can be set to the lower limit of the saturation value range.
[0132] Fusion Method 2: The hue and saturation of each pixel in the second color stamp are the hue and saturation of the first color, respectively. The brightness of each pixel in the second color stamp is determined based on the brightness of the corresponding pixel in the first color stamp and / or the brightness of the first color.
[0133] For example, taking the first pixel in the first color stamp corresponding to the second pixel in the second color stamp, the color of the first pixel being the third color, and the color of the second pixel being the fourth color as an example:
[0134] The hue of the fourth color is the same as the hue of the first color, and the saturation of the fourth color is the same as the saturation of the first color. The brightness of the fourth color can be the brightness of the third color, or the product of the brightness of the third color and a preset multiplier, or the sum of the brightness of the third color and a preset brightness, or the product of the third color and a preset multiplier, or the sum of the brightness of the third color and a preset brightness, or the weighted sum of the brightness of the third color and the brightness of the first color, or the product of the brightness of the third color and the brightness of the first color, or twice the product of the brightness of the third color and the brightness of the first color when the brightness of the first color is less than a brightness threshold (e.g., 50%, 60%, or other values), or 2 × (1 - brightness of the third color) × (1 - brightness of the first color) when the brightness of the first color is greater than a brightness threshold (e.g., 50%, 60%, or other values).
[0135] Blending Method 3: The hue and brightness of each pixel in the second color stamp are the hue and brightness of the first color, respectively. The saturation of each pixel in the second color stamp is determined based on the saturation of the corresponding pixel in the first color stamp and / or the saturation of the first color.
[0136] For example, taking the first pixel in the first color stamp corresponding to the second pixel in the second color stamp, the color of the first pixel being the third color, and the color of the second pixel being the fourth color as an example:
[0137] The hue of the fourth color is the same as that of the first color, and the brightness of the fourth color is the same as that of the first color.
[0138] The saturation of the fourth color can be the saturation of the third color, or the product of the saturation of the third color and a preset multiplier, or the sum of the saturation of the third color and a preset multiplier, or the sum of the saturation of the third color and a preset multiplier, or the sum of the saturation of the first color and a preset saturation, or the weighted sum of the saturation of the third color and the saturation of the first color, or the product of the saturation of the third color and the saturation of the first color.
[0139] Blending Method 4: The pixel values of each pixel in the second color stamp in the RGB color model are obtained by scaling the pixel values of the intermediate color in the RGB color model. Specifically, the brightness of the intermediate color is the brightness of the corresponding pixel in the first color stamp, and the hue and saturation of the intermediate color are the hue and saturation of the first color, respectively.
[0140] For example, taking the first pixel in the first color stamp corresponding to the second pixel in the second color stamp, the color of the first pixel being the third color, and the color of the second pixel being the fourth color as an example:
[0141] With the hue, saturation, and lightness of the first color in the HSY color model being H11, S11, and Y11 respectively, and the hue, saturation, and lightness of the third color in the HSY color model being H13, S13, and Y13 respectively, the hue, saturation, and lightness of the intermediate color in the HSY color model can be expressed as H11, S11, and Y13 respectively. After the intermediate color is converted from the HSY color model to the RGB color model (for example, by reversing formula (5) below or by converting based on formulas (6) to (11), the pixel value of the intermediate color in the RGB color model can be expressed as [R12, G12, B12] (with pixel values of R12, G12, and B12 in the red, green, and blue color channels respectively), the pixel values of the fourth color in the red, green, and blue channels of the RGB color model can be expressed as follows: [R14, G14, B14] = [V × R12, V × G12, V × B12] (1)
[0142] In formula (1), R14, G14, and B14 represent the pixel values of the fourth color in the red, green, and blue channels of the RGB color model, respectively; V represents the scaling factor, which is greater than or equal to 0 and less than or equal to 1 (i.e., 0 ≤ V ≤ 1).
[0143] In some embodiments, the scaling factor V can be determined based on the lightness of the first color in the HSV color model. For example, if the hue, saturation, and lightness of the first color in the HSV color model are H11', S11', and V11 (denoted as [H11', S11', V11]), the scaling factor V can be expressed as the following formula (2): V = V11 × e1 + e2 (2)
[0144] In formula (2), the sum of e1 and e2 is 1, and both e1 and e2 are numbers greater than or equal to 0. e1 and e2 can be empirical or experimental values. For example, e1 and e2 can both be 0.5, or e1 and e2 can be 0.35 and 0.65 respectively, or e1 and e2 can be 0.3 and 0.7 respectively, or e1 and e2 can be 0.6 and 0.4 respectively, or e1 and e2 can be 0.75 and 0.25 respectively. It should be understood that the above combinations of e1 and e2 are merely examples. In other embodiments, the combinations of e1 and e2 can be any combination that satisfies the condition that the sum of e1 and e2 is 1 and that e1 and e2 are non-negative numbers, and are not limited here.
[0145] In one embodiment, if the first color is not represented by the HSV color model, the first color can be converted to the HSV color model representation [H11', S11', V11] to obtain V11. For example, if the first color is represented by [R11, G11, B11] in the RGB color model, V11 can be the maximum value among R11, G11, and B11.
[0146] In some embodiments, when the first color and the third color are represented by the RGB color model, the electronic device can first convert the first color and the third color to the HSY color model respectively, and then combine the brightness of the third color with the hue and saturation of the first color to obtain the representation of the intermediate color in the HSY color model [H11, S11, Y13]. For example, when the first color is represented in the RGB color model as [R11, G11, B11] (the pixel values in the red, green, and blue color channels are R11, G11, and B11 respectively), and the third color is represented in the RGB color model as [R13, G13, B13] (the pixel values in the red, green, and blue color channels are R13, G13, and B13 respectively), the representations of the first color and the third color in the HSY color model can be expressed as follows: formula (3) and formula (4) respectively.
[0147] In formula (3), max means to find the maximum value and min means to find the minimum value.
[0148] The calculation method for H11 in formula (3) is as follows:
[0149] When max(R11, G11, B11) and min(R11, G11, B11) are equal, H11 is 0°.
[0150] When max(R11, G11, B11) is R11 and G11 is greater than or equal to B11, H11 is 60°×(G11-B11) / (max(R11, G11, B11)-min(R11, G11, B11)).
[0151] When max(R11, G11, B11) is R11 and G11 is less than B11, H11 is 60°×(G11-B11) / (max(R11, G11, B11)-min(R11, G11, B11))+360°.
[0152] When max(R11, G11, B11) is G11, H11 is 60°×(B11-R11) / (max(R11, G11, B11)-min(R11, G11, B11))+120°;
[0153] When max(R11, G11, B11) is B11, H11 is 60°×(R11-G11) / (max(R11, G11, B11)-min(R11, G11, B11))+240°.
[0154] In formula (4), max means to find the maximum value and min means to find the minimum value.
[0155] The calculation method for H13 in formula (4) is as follows:
[0156] When max(R13, G13, B13) and min(R13, G13, B13) are equal, H13 is 0°;
[0157] When max(R13, G13, B13) is R13 and G13 is greater than or equal to B13, H13 is 60°×(G13-B13) / (max(R13, G13, B13)-min(R13, G13, B13)).
[0158] When max(R13, G13, B13) is R13 and G13 is less than B13, H13 is 60°×(G13-B13) / (max(R13, G13, B13)-min(R13, G13, B13))+360°;
[0159] When max(R13, G13, B13) is G13, H13 is 60°×(B13-R13) / (max(R13, G13, B13)-min(R13, G13, B13))+120°;
[0160] When max(R13, G13, B13) is B13, H13 is 60°×(R13-G13) / (max(R13, G13, B13)-min(R13, G13, B13))+240°.
[0161] In some embodiments, the conversion relationship between the HSY color model and the RGB color model can be expressed as the following formula (5).
[0162] In formula (5), R, G, and B refer to the pixel values of the red, green, and blue color channels in the RGB color model (i.e., the color is represented in the RGB color model, denoted as [R, G, B]); maxRGB represents the maximum value among R, G, and B; minRGB represents the minimum value among R, G, and B; H, S, and Y refer to the values of hue, saturation, and lightness of the color in the HSY color model (i.e., the color is represented in the HSY color model, denoted as [H, S, Y]).
[0163] Based on the above formula (5), the representation of a color in the HSY color model can be obtained by substituting the representation of a color in the RGB color model into formula (5); or, the representation of a color in the RGB color model can be obtained by substituting the representation of a color in the HSY color model into formula (5) (or by using equivalent calculation formulas or algorithms). For example, for colors with different H values in the HSY color model, the way to convert the representation of a color in the HSY color model to its representation in the RGB color model can also be obtained based on the following formulas (6) to (11). The following is an introduction in conjunction with the value range of H.
[0164] For the case where 0°≤H<60°, the way to convert the color from the HSY color model to the RGB color model can be expressed as the following formula (6).
[0165] In formula (6), H, S, and Y refer to the hue, saturation, and lightness values of a color in the HSY color model (i.e., the representation of a color in the HSY color model, denoted as [H, S, Y]); R, G, and B refer to the pixel values of the red, green, and blue color channels of a color in the RGB color model (i.e., the representation of a color in the RGB color model, denoted as [R, G, B]); when Y is less than or equal to L... MIn the case of S' being min(S,Y / L) M ); when Y is greater than L M In the case of S', it is min(S, (1–Y) / (1–L) M ), min means to find the minimum value; L M It is 0.299 + 0.587 × H / 60°. It should be noted that the definitions of H, S, Y, R, G and B in the following formulas (7) to (11) are the same, and will not be repeated below.
[0166] For the case where 60°≤H<120°, the way to convert the color from the HSY color model to the RGB color model can be expressed as the following formula (7).
[0167] In formula (7), when Y is less than or equal to L M In the case of S' being min(S,Y / L) M ); when Y is greater than L M In the case of S', it is min(S, (1–Y) / (1–L) M ), min means to find the minimum value; L M The value is (0.299+0.587)-0.299×(H-60°) / 60°. For the case where 120°≤H<180°, the way the color is converted from the representation in the HSY color model to the representation in the RGB color model can be expressed as the following formula (8).
[0168] In formula (8), when Y is less than or equal to L M In the case of S' being min(S,Y / L) M ); when Y is greater than L M In the case of S', it is min(S, (1–Y) / (1–L) M ), min means to find the minimum value; L M It is 0.587 + 0.114 × (H - 120°) / 60°.
[0169] For the case where 180°≤H<240°, the way to convert the color from the HSY color model to the RGB color model can be expressed by the following formula (9).
[0170] In formula (9), when Y is less than or equal to L M In the case of S' being min(S,Y / L) M ); when Y is greater than L M In the case of S', it is min(S, (1–Y) / (1–L) M), min means to find the minimum value; L M It is (0.587+0.114)-0.587×(H-180°) / 60°.
[0171] For the case where 240°≤H<300°, the way to convert the color from the HSY color model to the RGB color model can be expressed by the following formula (10).
[0172] In formula (10), when Y is less than or equal to L M In the case of S' being min(S,Y / L) M ); when Y is greater than L M In the case of S', it is min(S, (1–Y) / (1–L) M ), min means to find the minimum value; L M It is 0.114 + 0.299 × (H - 240°) / 60°.
[0173] For the case where 300°≤H<360°, the way to convert the color from the HSY color model to the RGB color model can be expressed as the following formula (11).
[0174] In formula (11), when Y is less than or equal to L M In the case of S' being min(S,Y / L) M ); when Y is greater than L M In the case of S', it is min(S, (1–Y) / (1–L) M ), min means to find the minimum value; L M It is (0.114+0.299)-0.114×(H-300°) / 60°.
[0175] It should be noted that in other embodiments, the conversion between the HSY color model and the RGB color model can also be achieved in other ways, which are not limited here.
[0176] In some embodiments, the colors of the first color and each pixel in the first color stamp can be fused using fusion method one to fusion method three to obtain an intermediate color stamp. Then, the color of each pixel in the intermediate color stamp is scaled in the RGB color model based on the above formulas (1) and (2), and the scaled color is used as the color of each pixel in the second color stamp.
[0177] For example, consider a first pixel in a first color stamp corresponding to a second pixel in a second color stamp, with the first pixel's color being the third color and the second pixel's color being the fourth color. The hue of the intermediate color obtained by fusing the first and third colors is the same as the hue of the first color. The saturation of the intermediate color is based on the saturation of the first color and / or the third color, and the brightness of the intermediate color is based on the brightness of the first color and / or the third color. After obtaining the intermediate color, the electronic device can convert the intermediate color from the HSY color space, HSV color space, or other color spaces to the RGB color space. Finally, the electronic device can scale the representation of the intermediate color in the RGB color model (e.g., the aforementioned [R12, G12, B12]) based on the aforementioned formula (1) to obtain the fourth color.
[0178] In some embodiments, the hue of the intermediate color may be the same as the hue of the first color. The saturation of the intermediate color may be: the saturation of the first color; or the product of the saturation of the first color and a first value; or the sum of the saturation of the first color and the first saturation; or the saturation of the intermediate color is the saturation of the third color; or the product of the saturation of the third color and a second value; or the sum of the saturation of the third color and the second saturation; or the weighted sum of the saturation of the first color and the saturation of the third color; or the product of the saturation of the first color and the saturation of the third color. The brightness of the intermediate color can be: the brightness of the first color; or the product of the brightness of the first color and a third value; or the sum of the brightness of the first color and the first value; the brightness of the third color; or the product of the brightness of the third color and a fourth value; or the sum of the brightness of the third color and the second value; or the weighted sum of the brightness of the first color and the brightness of the third color; or the product of the brightness of the first color and the brightness of the third color; or, if the brightness of the first color is less than the brightness threshold, the brightness of the intermediate color is twice the product of the brightness of the first color and the brightness of the third color; if the brightness of the first color is greater than or equal to the brightness threshold, the brightness of the intermediate color is 1 - 2 × (1 - the brightness of the first color) × (1 - the brightness of the third color); wherein, if the brightness of the intermediate color is the same as the brightness of the first color, the saturation of the intermediate color is not the same as the saturation of the first color; if the brightness of the intermediate color is the same as the brightness of the third color, the saturation of the intermediate color is not the same as the saturation of the third color.
[0179] It should be noted that the above method of fusing the first color and the first color stamp is only an example. In other embodiments, the electronic device may also use other methods to fuse the colors of each pixel in the first color and the first color stamp to obtain the second color stamp, which is not limited here.
[0180] In some embodiments, the color brush may be configured with multiple color stamps (for example, in addition to the first color stamp mentioned above, the color brush may also include a fourth color stamp). The electronic device may also fuse a fifth color (e.g., a user-selected drawing color, a color randomly generated by the electronic device, etc.) with the colors of each pixel in the fourth color stamp to obtain a fifth color stamp with a color different from the fourth color stamp. Then, in response to the user's operation of drawing ink marks with the color brush, the electronic device may repeatedly draw the second color stamp, the fifth color stamp (and the aforementioned third color stamp) along the drawing trajectory to obtain colored ink marks. Based on this, the electronic device may, in response to the user's operation, generate ink marks that repeatedly draw multiple color stamps corresponding to the merged color stamps on a trajectory drawn by the user.
[0181] It should be noted that, since different color models can be equivalently converted, the method described above for blending the colors in the first color and the first color stamp based on hue, saturation, and brightness can also be converted to the corresponding color attributes in other color models for blending. For example, it can be converted to the pixel values of the three color channels in the RGB model for blending, or converted to hue, saturation, and brightness in the HSB model for blending, etc., and is not limited here.
[0182] It should be noted that the methods described above—methods one through three, which use hue, saturation, and brightness to fuse the first color and the first color stamp to obtain the hue, saturation, and brightness of each pixel in the second color stamp, and method four, which uses the RGB color model to fuse the first color and the first color stamp to obtain the pixel values of each pixel in the second color stamp—are merely examples. The colors of each pixel in the second color stamp obtained by methods one through four can be represented based on the three elements of color: hue, saturation, and brightness. They can also be represented through color attributes in various color models, or a conversion between these two representations can be made; no limitation is made here.
[0183] The following section uses the aforementioned brush B1 as an example to introduce a solution for generating colored ink marks on electronic devices when the colored brush is configured with multiple colored stamps.
[0184] For example, the electronic device can process the color image I2 in Figure 2A into a color stamp CB2 (as the fourth color stamp), and configure the color stamp CB2 as the stamp of the brush B1 (the specific configuration method will be described in detail in the section on the "multiple brushes" option below, and will not be repeated here). Then, when the electronic device detects that the user is drawing ink marks with the brush B1, it can fuse the fifth color with the color stamp CB2 to obtain a fused color stamp CB2' (as the fifth color stamp) with a different color than the color stamp CB2, and repeat the drawing along the drawing trajectory with the fused color stamp CB1' and the fused color stamp CB2' (or repeat the drawing along the drawing trajectory with the fused color stamp CB1', the fused color stamp CB1'', and the fused color stamp CB2') to obtain the color ink marks.
[0185] For example, referring to Figure 4A, when the electronic device detects that the user is drawing ink marks with the brush B1, the electronic device can blend each pixel in the color stamp CB2 with the fifth color (hue of 261°, saturation of 99%, and brightness of 60%) to obtain the blended color stamp CB2'.
[0186] Then, referring to Figure 4B, the electronic device can respond to the user's operation of drawing the aforementioned trajectory L1 using brush B1, and repeatedly draw the fused color stamp CB1' shown in Figure 3A and the fused color stamp CB2' shown in Figure 4A along trajectory L1 to obtain a colored ink mark IK4. The colored ink mark IK4 includes corresponding stamps (fused color stamp CB1', fused color stamp CB2') of various patterns (colored stamp CB1, colored stamp CB2).
[0187] Alternatively, referring to Figure 4C, the electronic device can also respond to the user's operation of drawing the aforementioned trajectory L1 with brush B1, and repeatedly draw the fused color stamp CB2' shown in Figure 3A, the fused color stamp CB1″ shown in Figure 3C, and the fused color stamp CB2' shown in Figure 4A along trajectory L1 to obtain a colored ink mark IK5. The colored ink mark IK5 includes corresponding stamps (fused color stamp CB1', fused color stamp CB1″, fused color stamp CB2') of various patterns (colored stamp CB1, colored stamp CB2). The same pattern of colored stamp can be fused with different colors and colored stamps to obtain (fused color stamp CB1' obtained by fused color stamp CB1 with the first color, fused color stamp CB1″ obtained by fused color stamp CB1 with the second color).
[0188] In some embodiments, the electronic device may also respond to user operation by adjusting at least one stamp parameter of the first color stamp (e.g., stamp size, stamp roundness, stamp orientation, stamp spacing or stamp density, stamp opacity, etc.), and merging the first color and the colors of each pixel in the first color stamp after adjusting the stamp parameters to obtain a second color stamp.
[0189] In some embodiments, during the repeated drawing of the aforementioned second, third, and / or fifth color stamps along the drawing trajectory, at least one stamp parameter can dynamically change. For example, the stamp parameters may include at least one of the following parameters: stamp size, stamp roundness, stamp orientation, stamp hue, stamp saturation, stamp brightness, stamp spacing (or stamp density), stamp opacity, and stamp dispersion.
[0190] In some embodiments, when the drawing trajectory is drawn by the user using a stylus, at least one stamp parameter of the aforementioned second and / or third and / or fifth color stamps can dynamically change based on changes in stylus parameters. Exemplarily, stylus parameters may include, but are not limited to, stylus tilt angle (e.g., the angle between the stylus axis and the plane of the electronic device's display screen, or the angle between the stylus axis and the normal to the plane of the electronic device's display screen), stylus pressure (the pressure exerted on the stylus tip), and stylus rotation angle (the angle of rotation of the stylus around its axis).
[0191] The following section uses the aforementioned brush B1 as an example to introduce a scheme for configuring brush parameters and stamp parameters of electronic devices based on user operations.
[0192] First, we will introduce how to adjust the parameters in the line options of brush B1 on electronic devices.
[0193] For example, after detecting a user's click on the line option in the aforementioned brush editing interface P6, the electronic device can display the brush editing interface P20 shown in Figure 5A. Referring to Figure 5A, the brush editing interface P20 may include functional controls such as spacing, size, size jitter, and opacity jitter. Wherein:
[0194] The spacing control is used to adjust the spacing between the color stamp CB1. Depending on the parameters in the spacing control, the spacing of the merged color stamps (e.g., merged color stamp CB1', merged color stamp CB1″, etc.) generated from the color stamp CB1 will vary. Specifically, referring to Figure 5B, the spacing between the merged color stamps of color stamp CB1 can increase as the parameter value in the spacing control increases. For example, when the parameter value is 0%, the stamp spacing can be a preset value; when the parameter value is 40%, the stamp spacing can increase to 140% of the preset value; and when the parameter value is 110%, the stamp spacing can increase to 210% of the preset value.
[0195] The size control is used to adjust the size of the color stamp CB1. For example, with different parameters in the size control, the size of the merged color stamp of color stamp CB1 will be different in the color ink generated based on the merged color stamp. Specifically, referring to Figure 5C, the stamp size of the merged color stamp of color stamp CB1 can increase as the size parameter value in the size control increases. For example, when the size parameter value is 0%, the stamp size can be the original size; when the size parameter value is 40%, the stamp size can be increased to 140% of the original size; and when the size parameter value is 200%, the stamp size can be increased to 200% of the original size.
[0196] The size jitter control is used to adjust the amplitude or frequency of the size change of the fused color stamp corresponding to color stamp CB1 along the ink stroke. When the size jitter parameter value (hereinafter referred to as the size jitter value) in the size jitter control is not 0, the size of the fused color stamp of color stamp CB1 will be different in the color ink stroke generated based on the fused color stamp of color stamp CB1 (for example, the stamp size can change randomly). Specifically, referring to Figure 5D, the amplitude of the size change of the fused color stamp of color stamp CB1 can increase as the size jitter value in the size jitter control increases. For example, when the size jitter value is 0%, the stamp size can remain unchanged; when the size jitter value is 20%, the stamp size can change between (1-20%=80%) and (1+20%=120%) of the original size; when the size jitter value is 60%, the stamp size can change between (1-60%=40%) and (1+60%=160%) of the original size.
[0197] The opacity jitter control is used to adjust the magnitude of the opacity change of the second color stamp corresponding to color stamp CB1 along the ink stroke. For example, when the opacity parameter value in the opacity jitter control (hereinafter referred to as the opacity jitter value) is not 0, the opacity of the blended color stamp of color stamp CB1 will be different in the color ink stroke generated based on the blended color stamp of color stamp CB1 (for example, the stamp opacity can change randomly). Specifically, referring to Figure 5E, the magnitude of the change in the opacity of the blended color stamp of color stamp CB1 can increase as the opacity jitter value in the opacity control increases. For example, when the opacity jitter value is 0%, the stamp opacity can remain unchanged; when the opacity jitter value is 20%, the stamp opacity can change between 80% and 100%; when the opacity jitter value is 60%, the stamp opacity can change between 40% and 100%.
[0198] It should be noted that the above-mentioned settings for stamp size, stamp spacing, size jitter, and opacity jitter are only examples. In other embodiments, electronic devices may also adjust the size, stamp spacing, size jitter, and opacity jitter in other ways, which are not limited here.
[0199] The following describes how to adjust the parameters in the shape options of brush B1 on electronic devices.
[0200] As shown in Figure 6A, the shape options in the aforementioned brush editing interface P6 can include controls for functions such as scattering, rotation, randomization, and following the brush tip rotation. After the electronic device detects the user's upward swipe operation in area D1 of the brush editing interface P6, it can also display controls for functions such as horizontal flipping, vertical flipping, pressure roundness, tilt roundness, and corner roundness, as well as adjustment controls U21. Among them:
[0201] The scatter control is used to adjust the range of variation in the distance between the center of the color stamp CB1 and the points on the drawing trajectory when the color stamp CB1 is repeatedly drawn. For example, referring to Figure 6B, with different scatter values in the scatter control, the range of variation in the distance between the fused color stamp of color stamp CB1 and the points on the drawing trajectory in the color ink generated by the fused color stamp of color stamp CB1 is different. Specifically, referring to Figure 6B, the range of variation in the distance between the fused color stamp of color stamp CB1 and the points on the drawing trajectory can increase with the increase of the scatter value. For example, when the scatter value is 0%, the center of the stamp can overlap with the points on the drawing trajectory; when the scatter value is 80%, the distance between the center of the stamp and the points on the drawing trajectory in at least one direction can vary between 0% and 80% of the preset distance PL (equivalent to the distance between the center of the stamp and the points on the drawing trajectory in the X direction shown in Figure 6B can vary from 0 to 80% × PL, and / or the distance between the center of the stamp and the points on the drawing trajectory in the Y direction shown in Figure 6B can vary from 0 to 80% × PL).
[0202] The rotation control is used to adjust the stamp angle of the color stamp CB1. Depending on the angle in the rotation sub-edit, the stamp angle of the merged color stamp CB1 generated from the merged color stamp will differ. Specifically, referring to Figure 6C, the rotation angle of the merged color stamp CB1 relative to its original direction increases with the increase of the rotation parameter value in the rotation control. For example, when the rotation parameter value is 0°, the merged color stamp CB1 maintains its original direction (the rotation angle of the merged color stamp CB1 relative to its original direction is 0°); when the rotation parameter value is 45°, the merged color stamp CB1 rotates 45° clockwise (or counterclockwise); and when the rotation parameter value is 150°, the merged color stamp CB1 rotates 150° clockwise relative to its original direction.
[0203] The vertical flip control is used to flip the color stamp CB1 vertically (flipping it along an axis parallel to the horizontal direction (e.g., the X direction shown in Figure 6A); the horizontal flip control is used to flip the color stamp CB1 horizontally (flipping it along an axis parallel to the vertical direction (e.g., the Y direction shown in Figure 6A)).
[0204] The randomization control is used to enable or disable the randomization of stamp parameters such as scatter value, stamp angle, and stamp roundness. When randomization is enabled, the scatter value, stamp angle, and stamp roundness of the fused color stamp CB1 will change randomly in the color ink generated based on the fused color stamp CB1.
[0205] The "Follow Pen Tip Rotation" control is used to enable or disable the function of rotating the stamp with the pen tip. When the function of rotating with the pen tip is enabled, in the color ink generated based on the fused color stamp CB1, the orientation (direction and position, such as the aforementioned scattering value, stamp angle, etc.) of the fused color stamp CB1 relative to the ink ink will change with the pen tip (or stylus tilt angle or stylus rotation angle) when drawing the ink ink.
[0206] The adjustment control U21 is used to adjust the roundness of the color stamp CB1 (e.g., the roundness of the outer circle of the color stamp CB1, or the length-to-width ratio of the color stamp CB1), the stamp angle, etc.
[0207] The pressure roundness control is used to enable the pressure roundness function (the function that changes the roundness of the stamp according to the stylus pressure). When the pressure roundness function is enabled, the roundness of the stamp in the colored ink generated based on the second colored stamp corresponding to the colored stamp CB1 will change with the stylus pressure. For example, referring to Figure 6D, as the user draws the aforementioned trajectory L1, the stylus pressure gradually increases, and as the aforementioned blended colored stamp CB1' is repeatedly drawn along trajectory L1, the roundness of the blended colored stamp CB1' gradually decreases (visually, the size of the blended colored stamp CB1' in the vertical direction becomes smaller and smaller).
[0208] The tilt roundness control is used to enable the tilt roundness function (the function that changes the roundness of the stamp according to the stylus tilt angle). When the tilt roundness function is enabled, in the colored ink generated based on the second colored stamp corresponding to the colored stamp CB1, the roundness of the stamp will change with the tilt angle of the stylus. For example, referring to Figure 6D, as the user draws the aforementioned trajectory L1, the stylus tilt angle gradually increases, and as the aforementioned merged colored stamp CB1' is repeatedly drawn along trajectory L1, the roundness of the merged colored stamp CB1' gradually decreases (visually, the size of the merged colored stamp CB1' in the vertical direction becomes smaller and smaller).
[0209] The corner roundness control is used to enable the corner roundness function (the function that changes the roundness of the stamp according to the stylus angle). When the corner roundness function is enabled, the roundness of the stamp in the colored ink generated based on the second colored stamp corresponding to the colored stamp CB1 will change with the stylus angle. For example, referring to Figure 6D, as the user draws the aforementioned trajectory L1, the stylus angle gradually increases, and as the aforementioned merged colored stamp CB1' is repeatedly drawn along trajectory L1, the roundness of the merged colored stamp CB1' gradually decreases (visually, the size of the merged colored stamp CB1' in the vertical direction becomes smaller and smaller).
[0210] It should be noted that the above-mentioned settings for functions such as horizontal flip, vertical flip, stamp roundness, pressure roundness, tilt roundness, and corner roundness are only examples. In other embodiments, the electronic device may also adjust the horizontal flip, vertical flip, stamp roundness, pressure roundness, tilt roundness, and corner roundness in other ways, which are not limited here.
[0211] The following describes how to adjust the parameters in the color dynamics options of brush B1 on electronic devices.
[0212] For example, after detecting a user's click on the color dynamics option in the aforementioned brush editing interface P6, the electronic device can display the brush editing interface P22 shown in Figure 7A. Referring to Figure 7A, the brush editing interface P22 may include controls for functions such as color jitter (a function that randomly changes the hue, saturation, brightness, etc. of the stamp) and pressure color (a function that changes the hue, saturation, brightness, etc. of the stamp according to the pressure applied to the touchscreen of the electronic device (hereinafter referred to as touch pressure) or the pressure of the stylus). After detecting a user's swipe-up operation in area D2 of the brush editing interface P22, the electronic device can display the brush editing interface P22', which includes controls for functions such as tilt color (a function that changes the hue, saturation, brightness, etc. of the stamp according to the tilt angle of the stylus) and corner color (an option that changes the hue, saturation, brightness, etc. of the stamp according to the corner of the stylus).
[0213] The hue parameter in the color jitter control is used to adjust the range and / or frequency of hue changes in the blended color of the color stamp CB1. The larger the hue parameter value (hereinafter referred to as the hue jitter value) in the color jitter control, the larger the range and frequency of hue changes in the blended color of the color stamp CB1, and the more blended color stamps the color stamp CB1 will have.
[0214] For example, referring to Figure 7B, when the hue jitter value is 0%, the hue, saturation, and brightness of the blended colors of color stamp CB1 are all the same (hue is 0°, saturation is 81%, and brightness is 100%), which is equivalent to all blended color stamps of color stamp CB1 being the same. When the hue jitter value is 30%, the hues of the first to third blended colors corresponding to color stamp CB1 are different (0°, 200°, and 50° respectively), the saturation is the same (all are 81%), and the brightness is the same (all are 100%). The hue, saturation, and brightness of the first and fourth blended colors of color stamp CB1 are the same (hue is 0°, saturation is 81%, and brightness is 100%); which is equivalent to the first to third blended color stamps in the generated color ink being different from each other, and the first and fourth blended color stamps being the same. With a hue dithering value of 100%, the first to fourth blended colors of the color stamp CB1 have different hues (0°, 200°, 50° and 240° respectively), the same saturation (all 81%), and the same brightness (all 100%), which is equivalent to all the blended color stamps of the color stamp CB1 in the color ink being different.
[0215] In some embodiments, the hue in the color dithering control can also be used to adjust the hue of the aforementioned second color stamp. When the hue in the color dithering control is not 0, the hue of all pixels can dynamically change during the repeated drawing of the second color stamp along the drawing trajectory. For example, during the repeated drawing of the second color stamp along the drawing trajectory, the hue of each pixel can be adjusted as a whole, such as by increasing proportionally, decreasing proportionally, adding or subtracting the same hue offset, etc.
[0216] The saturation value in color jitter is used to adjust the range and / or frequency of saturation variation in the blended colors of the color stamp CB1. The larger the saturation parameter value (hereinafter referred to as the saturation jitter value), the larger the range and frequency of saturation variation in the blended colors of the color stamp CB1, and the more blended color stamps the color stamp CB1 will have.
[0217] For example, referring to Figure 7C, when the saturation jitter value is 0%, the hue, saturation, and brightness of the blended colors of color stamp CB1 are all the same (hue is 0°, saturation is 81%, and brightness is 100%), which is equivalent to all blended color stamps of color stamp CB1 being identical. When the saturation jitter value is 30%, the saturation of the first to fourth blended colors of color stamp CB1 are different (81%, 100%, 70%, and 83% respectively, with a small range of variation (e.g., 30%)), the hue is the same (all are 0°), and the brightness is the same (all are 100%), which is equivalent to all blended color stamps of color stamp CB1 in the generated color ink being different from each other. With a saturation jitter value of 100%, the saturation of the first to fourth blended colors of the color stamp CB1 are different (100%, 40%, 20% and 95% respectively, with a large range of variation (e.g., 100%)), the hue is the same (all are 0°), and the brightness is the same (all are 100%), which is equivalent to all blended color stamps of the color stamp CB1 in the color ink being different.
[0218] In some embodiments, the saturation in the color dithering control can also be used to adjust the saturation of the aforementioned second color stamp. When the saturation in the color dithering control is not 0, the saturation of all pixels can dynamically change during the repeated drawing of the second color stamp along the drawing trajectory. For example, during the repeated drawing of the second color stamp along the drawing trajectory, the saturation of the color of each pixel can be adjusted as a whole, such as by increasing it proportionally, decreasing it proportionally, or adding or subtracting the same saturation offset.
[0219] In some embodiments, the saturation in the color dithering control can also be used to adjust the saturation of each pixel in the first color stamp. When the saturation in the color dithering control is not 0, the electronic device can dynamically adjust (e.g., randomly adjust) the saturation of each pixel in the first color stamp, and then merge the first color stamp with the adjusted saturation and the blend color to obtain a blended color stamp. For example, the electronic device can adjust the overall saturation of the color of each pixel in the first color stamp, such as by increasing it proportionally, decreasing it proportionally, adding or subtracting the same saturation bias, etc., and then merge the first color stamp with the blend color (e.g., the first color or other colors) based on the adjusted first color stamp.
[0220] The brightness in each color jitter control is used to adjust the range and / or frequency of brightness variation of the blended color of the color stamp CB1. The larger the brightness parameter value (hereinafter referred to as brightness jitter value), the larger the range and frequency of brightness variation of the blended color of the color stamp CB1, and the more blended color stamps of the color stamp CB1 there are in the generated color ink.
[0221] For example, referring to Figure 7D, when the brightness jitter value is 0%, the hue, brightness, and saturation of the blended colors of the color stamp CB1 are all the same (hue is 0°, saturation is 81%, and brightness is 100%), which is equivalent to all blended color stamps of color stamp CB1 being identical. When the brightness jitter value is 30%, the brightness of the first to fourth blended colors of color stamp CB1 are different (100%, 90%, 60%, and 70% respectively, with a small range of variation (e.g., 40%)), the hue is the same (all are 0°), and the saturation is the same (all are 81%), which is equivalent to all blended color stamps of color stamp CB1 in the generated color ink being different from each other. With a saturation jitter value of 100%, the first to fourth blended colors of the color stamp CB1 have different brightness (20%, 100%, 60%, and 80% respectively, with a large range of variation (e.g., 100%)), the same hue (all 0°), and the same saturation (all 81%), which is equivalent to all blended color stamps of the color stamp CB1 in the color ink being different.
[0222] In some embodiments, the brightness in the color dithering control can also be used to adjust the brightness of the aforementioned second color stamp. When the brightness in the color dithering control is not 0, the brightness of all pixels can dynamically change during the repeated drawing of the second color stamp along the drawing trajectory. For example, during the repeated drawing of the second color stamp along the drawing trajectory, the brightness of each pixel can be adjusted as a whole, such as increasing proportionally, decreasing proportionally, adding or subtracting the same brightness offset, etc.
[0223] In some embodiments, the brightness in the color dithering control can also be used to adjust the brightness of each pixel in the first color stamp. When the brightness in the color dithering control is not 0, the electronic device can dynamically adjust (e.g., randomly adjust) the brightness of each pixel in the first color stamp. The electronic device can then merge the first color stamp with the adjusted brightness and the blending color to obtain a blended color stamp. For example, the electronic device can adjust the brightness of the color of each pixel in the first color stamp as a whole, such as by increasing it proportionally, decreasing it proportionally, adding or subtracting the same brightness offset, and then merge the adjusted first color stamp with the blending color (e.g., a first color or other colors).
[0224] The pressure color control is used to adjust the range or frequency of change of the hue, saturation, and brightness of the blended colors of the Color Stamp CB1 with stylus pressure (or touch pressure). When one or more color parameters (hue, saturation, brightness) in the pressure color control are not zero, those parameters will change with the stylus pressure. Referring to Figure 7E, with the hue parameter value in the pressure color control at 30% (not zero), at a stylus pressure of 0.3N, the hue of the first and fourth blended colors of the Color Stamp CB1 is 0°; at a stylus pressure of 0.8N, the hue of the second blended color of the Color Stamp CB1 is 200°; and at a stylus pressure of 1.1N, the hue of the third blended color of the Color Stamp CB1 is 50°.
[0225] In some embodiments, the hue, saturation, and brightness of the pressure color control can also be used to adjust the hue, saturation, and brightness of the aforementioned second color stamp. When the hue parameter value in the pressure color control is not 0, the hue can change based on the stylus pressure during the repeated drawing of the second color stamp along the drawing trajectory; when the saturation parameter value in the pressure color sub-control is not 0, the saturation can change based on the stylus pressure during the repeated drawing of the second color stamp along the drawing trajectory; when the brightness parameter value in the pressure color control is not 0, the brightness can change based on the stylus pressure during the repeated drawing of the second color stamp along the drawing trajectory.
[0226] In some embodiments, the saturation and brightness in the pressure color control can also be used to adjust the saturation and brightness of each pixel in the first color stamp. When the saturation and / or brightness in the pressure color control are not 0, the electronic device can adjust the saturation and / or brightness of the first color stamp based on the stylus pressure, and blend the adjusted first color stamp with the blend color to obtain a blended color stamp.
[0227] The tilt color control adjusts the range or frequency of change of the hue, saturation, and brightness of the blended colors in the Color Stamp CB1 as the pen tilt angle changes. When one or more color parameters (hue, saturation, brightness) in the tilt color control are not zero, these parameters will change with the pen tilt angle. Referring to Figure 7F, with a saturation value of 50% (not zero) in the tilt color control, the saturation of the first and fourth blended colors of the Color Stamp CB1 is 70% at a pen tilt angle of 35°; the saturation of the second blended color is 80% at a pen tilt angle of 55°; and the saturation of the third blended color is 95% at a pen tilt angle of 75°.
[0228] In some embodiments, the hue, saturation, and brightness in the tilt color control can also be used to adjust the hue, saturation, and brightness of the aforementioned second color stamp. When the hue parameter value in the tilt color control is not 0, the hue can change based on the stylus tilt angle during the repeated drawing of the second color stamp along the drawing trajectory; when the saturation parameter value in the tilt color control is not 0, the saturation can change based on the stylus tilt angle during the repeated drawing of the second color stamp along the drawing trajectory; when the brightness parameter value in the tilt color control is not 0, the brightness can change based on the stylus tilt angle during the repeated drawing of the second color stamp along the drawing trajectory.
[0229] In some embodiments, the saturation and brightness in the tilt color control can also be used to adjust the saturation and brightness of each pixel in the first color stamp. When the saturation and / or brightness in the tilt color control are not 0, the electronic device can adjust the saturation and / or brightness of the first color stamp based on the stylus tilt angle, and blend the adjusted first color stamp with the blend color to obtain a blended color stamp.
[0230] The corner color control is used to adjust the range or frequency of change of the hue, saturation, and brightness of the blended color of the Color Stamp CB1 as the stylus angle changes. When one or more color parameters (hue, saturation, brightness) in the corner color control are not 0, those parameters will change with the stylus angle. Referring to Figure 7G, with both hue and brightness values at 50% in the corner color control, when the stylus angle is 35°, the hue of the first blended color of the Color Stamp CB1 is 0° and the brightness is 50%; when the stylus angle is 55°, the hue of the second and fourth blended colors of the Color Stamp CB1 is 200° and the brightness is 70%; and when the stylus angle is 75°, the hue of the third blended color of the Color Stamp CB1 is 50° and the brightness is 80%.
[0231] In some embodiments, the hue, saturation, and brightness of the corner color control can also be used to adjust the hue, saturation, and brightness of the aforementioned second color stamp. When the hue parameter value in the corner color control is not 0, the hue can change based on the stylus angle during the repeated drawing of the second color stamp along the drawing trajectory; when the saturation parameter value in the corner color sub-control is not 0, the saturation can change based on the stylus angle during the repeated drawing of the second color stamp along the drawing trajectory; when the brightness parameter value in the corner color control is not 0, the brightness can change based on the stylus angle during the repeated drawing of the second color stamp along the drawing trajectory.
[0232] In some embodiments, the saturation and brightness in the corner color control can also be used to adjust the saturation and brightness of each pixel in the first color stamp. When the saturation and / or brightness in the corner color control are not 0, the electronic device can adjust the saturation and / or brightness of the first color stamp based on the stylus corner, and blend the adjusted first color stamp with the blend color to obtain a blended color stamp.
[0233] The following describes how to adjust the parameters in the stylus options of the B1 brush on electronic devices.
[0234] For example, after detecting a user's click on the stylus option in the aforementioned brush editing interface P6, the electronic device can display the brush editing interface P23 shown in Figure 8A. Referring to Figure 8A, the brush editing interface P23 may include controls for functions such as pressure following, tilt following, and corner following. Wherein:
[0235] The pressure follow control is used to configure the range or frequency of change of the stamp parameters (such as stamp size, stamp opacity, stamp angle, stamp scatter, stamp spacing, stamp roundness, etc.) of the color stamp CB1 with stylus pressure. When one or more stamp parameters in the pressure follow control have non-zero values, in the color ink generated by the fused color stamp based on the color stamp CB1, when the fused color stamp is drawn at a certain position on the drawing trajectory, those one or more stamp parameters are determined based on the stylus pressure at that position during the drawing process.
[0236] The tilt follow control is used to configure the range or frequency of change of the stamp parameters (such as stamp size, stamp opacity, stamp angle, stamp scatter, stamp spacing, stamp roundness, etc.) of the color stamp CB1 as the stylus tilt angle changes. When one or more stamp parameters in the tilt follow control have non-zero values, in the color ink generated by the fused color stamp based on the color stamp CB1, when the fused color stamp is drawn at a certain position on the drawing trajectory, these one or more stamp parameters are determined based on the stylus tilt angle at that position during the drawing process.
[0237] The Corner Follow control is used to configure the range or frequency of change of the stamp parameters (such as stamp size, stamp opacity, stamp angle, stamp scatter, stamp spacing, stamp roundness, etc.) of the color stamp CB1 as the stylus angle changes. When one or more stamp parameters in the Corner Edit sub-option have non-zero values, in the color ink generated by the fused color stamp based on the color stamp CB1, when the fused color stamp is drawn at a certain position on the drawing trajectory, these one or more stamp parameters are determined based on the stylus angle at that position during the drawing process.
[0238] It should be noted that in some embodiments, the brush parameters may have more configuration options. For example, the aforementioned texture options may include controls for overlaying additional textures onto the color stamps, and the aforementioned rendering options may include controls for configuring the rendering intensity of the brush's color stamps (e.g., weak, uniform, strong, etc.), etc., which will not be elaborated here. The electronic device can adjust other parameters of brush B1 based on the corresponding configuration options.
[0239] For example, referring to Figure 8B, the electronic device can configure a texture W1 for the color stamp CB1 based on the user's operation in the texture options. When the electronic device detects that the user has drawn a trajectory L1 using a brush B1 configured with texture W1, it can merge texture W1 with the color stamp CB1 (or the aforementioned merged color stamp CB1', merged color stamp CB1″) to obtain a color stamp CB3, and then repeatedly draw the color stamp CB3 along trajectory L1 to obtain a color ink mark IK6. In the color ink mark IK6, the outline (leaf shape) of the color stamp CB3 is preserved, and the texture in the color stamp CB3 is obtained by superimposing texture W1 with the texture of the color stamp CB1.
[0240] In some embodiments, texture W1 and color stamp CB1 can be blended using a multiply blending mode to obtain color stamp CB3. In this case, the pixel value [R-CB3, G-CB3, B-CB3] of a certain pixel in color stamp CB3 in the red, green, and blue channels of the RGB model can be represented as [R-CB1×R-W1, G-CB1×G-W1, B-CB1×B-W1] / A. Here, R-CB1, G-CB1, and B-CB1 represent the pixel values of the corresponding pixel in color stamp CB3 in the red, green, and blue channels of the RGB model, respectively; R-W1, G-W1, and B-W1 represent the pixel values of the corresponding pixel in texture W1 in the red, green, and blue channels of the RGB model, respectively; and A is the maximum value of the pixel values in the red, green, and blue channels.
[0241] In some embodiments, the texture W1 and the color stamp CB1 can be blended using color mixing modes such as Normal, Darken, Color Burn, Linear Burn, Color Dodge, Difference, Subtract, Overlay, Dissolve, Darken, Lighten, Screen, Linear Dodge, Lighten, Soft Light, Hard Light, Bright Light, Linear Light, Point Light, Solid Color Mix, Exclusion, Division, Hue, Saturation, Color, and Brightness. For details, please refer to the description below; further elaboration will not be provided here.
[0242] In some embodiments, the electronic device can also fuse the color stamp CB3 and the blending color to obtain a blended color stamp, and repeatedly draw the blended color stamp along the drawing trajectory to generate color ink. The method of fusion of the color stamp CB3 and the blending color can be referred to the embodiments described above, and will not be repeated here.
[0243] The following describes how to adjust the parameters in the multi-brush option of the B1 brush on electronic devices.
[0244] The multiple brush option allows a brush to be configured with multiple stamps (e.g., 2, 3, 4, etc.), at least one of which can be a colored stamp. For ease of description, the following describes the technical solution of this application by taking the configuration of 2 colored stamps for brush B1 as an example.
[0245] For example, after detecting that the user clicks the multi-brush option on the aforementioned brush editing interface P6, the electronic device can display the brush editing interface P24 shown in Figure 9. Referring to Figure 9, the brush editing interface P24 can display a preview of the multi-brush switch U22, the add control U23, the blending mode control U24, and the color stamp CB1. Among them, the multi-brush switch U22 is used to enable the multi-brush function of brush B1, the add control U23 is used to add a stamp to the brush with the multi-brush function enabled, and the blending mode control U24 is used to configure the blending mode of the areas where different stamps are superimposed (e.g., normal, multiply, darken, color burn, linear burn, color dodge, difference, subtract, cover, dissolve, dark, lighten, screen, linear dodge, lighten, soft light, hard light, bright light, linear light, point light, solid color mix, exclude, divide, hue, saturation, color, brightness, etc.).
[0246] Referring again to Figure 9, after detecting a user's click on the add control U23, the electronic device can display the add stamp window U25. The add stamp window U25 can include previews of stamps already stored in the electronic device (e.g., stamps BB1 and BB2) and a new stamp control U251. After detecting a user's click on the new stamp control U251, the electronic device can display the aforementioned image selection interface P4. Then, in response to the user selecting image I2 and clicking the OK control U17, the electronic device can process the color image I2 into a color stamp CB2 and display a preview image of the color stamp CB2 in the add stamp window U25'. Then, in response to the user selecting color stamp CB2 and clicking the OK control U26, the electronic device can configure the color stamp CB2 as the second color stamp (fourth color stamp) of the aforementioned brush B1 and display the brush editing interface P25. Compared to the aforementioned brush editing interface P24, the brush editing interface P25 adds a preview image of the colored stamp CB2, a color control U27 for the colored stamp CB2, and a stamp selection control U28. In some embodiments, the electronic device can also add more stamps to the brush B1 through the above process, which will not be elaborated here.
[0247] In some embodiments, the electronic device may also respond to the user's operation on the "CB2" option in the stamp selection control U28, display the editing interface P26 of the color stamp CB2, and modify the stamp parameters of the color stamp CB2 (such as the parameters involved in the line options, shape options, color dynamic options, stylus options, etc. in the editing interface P26) according to the user's operation. For details, please refer to the process of editing the color stamp CB1, which will not be elaborated here.
[0248] In some embodiments, each color stamp configured in the multiple brushes of the electronic device can be referred to as a brush layer (e.g., color stamp CB1 and color stamp CB2 can be referred to as brush layers respectively).
[0249] In some embodiments, the parameters involved in each brush in the multi-brush option can be individually adjusted with reference to the parameters involved in the color stamp CB1 mentioned above.
[0250] In some embodiments, the parameters involved in each brush in the multi-brush option may be the same as the parameters involved in the color stamp CB1.
[0251] In some embodiments, the electronic device can, in response to a user's operation in the color control U28 of the brush editing interface P25, configure a drawing color (as a fifth color) for the color stamp CB2. This fifth color is used to blend with the colors of each pixel in the color stamp CB2 to obtain a blended color stamp of the color stamp CB2 (as a fifth color stamp). When the multi-brush function of the brush B1 is enabled, the electronic device can, in response to the user's drawing trajectory operation, repeatedly draw the blended color stamps corresponding to the color stamp CB1 (e.g., the aforementioned blended color stamp CB1' and blended color stamp CB1″) and the blended color stamps corresponding to the color stamp CB2 (e.g., the aforementioned blended color stamp CB2') along the user's drawing trajectory to obtain colored ink marks (e.g., the aforementioned colored ink marks IK4 and colored ink marks IK5).
[0252] The technical solution of this application will be described below with reference to the scenarios shown in Figures 2A to 9.
[0253] For example, Figure 10 illustrates a flowchart of an ink generation method according to some embodiments of this application. The main body of this process can be an electronic device. As shown in Figure 10, the method includes:
[0254] S1001, It was detected that the user selected the first brush, and the first brush stamp includes the first colored stamp.
[0255] The electronic device triggers the ink generation method of this application when it detects that the user selects a first brush stroke including a first colored stamp.
[0256] For example, after an electronic device detects that a user has selected the aforementioned brush B1, it can trigger the ink generation method of this application.
[0257] In some embodiments, the first color stamp may be a preset color stamp, or it may be generated by the electronic device based on a first color image selected by the user (such as the aforementioned color image I1). For example, the electronic device may use at least a portion of the color image selected by the user as the first color stamp.
[0258] In some embodiments, after acquiring a color image selected by the user, the electronic device can identify the subject (e.g., people, buildings, animals, trees, flowers, etc.) in the color image through an artificial intelligence model or other means (or cutout), and use the subject in the color image as the first color stamp.
[0259] In some embodiments, after acquiring a color image selected by the user, the electronic device can edit the color image based on the user's operation (e.g., draw ink marks in the color image, delete part of the image content in the color image, enhance the image content in the color image, etc.), and use at least a part of the edited color image as a first color stamp.
[0260] In some embodiments, the electronic device may also acquire multiple color images, stitch the multiple color images (or the main body in the multiple color images) into a single color image, and use at least a portion of the single color image as a first color stamp.
[0261] In some embodiments, the first color stamp may also be a color stamp obtained by fusing the original color stamp in the first brush with a texture selected by the user. For example, in the case shown in FIG8B, the first color stamp may be a color stamp obtained by fusing the color stamp CB1 with the texture W1.
[0262] S1002, in response to the user's drawing operation, generate and display the color ink mark corresponding to the drawing operation, wherein the color ink mark includes at least one second color stamp repeatedly drawn along the drawing trajectory corresponding to the drawing operation, and the second color stamp is obtained by blending the first color with the color of each pixel in the first color stamp.
[0263] After detecting a user's drawing operation based on the first brush, the electronic device can respond to the user's drawing operation by repeatedly drawing at least one second color stamp along the drawing trajectory corresponding to the drawing operation, thereby obtaining and displaying the color ink mark corresponding to the drawing operation.
[0264] The following section describes how electronic devices generate and display the corresponding colored ink marks for drawing operations, based on the different number of stamps in the first brush stroke.
[0265] First, we will introduce how an electronic device generates and displays the colored ink corresponding to the drawing operation when the first brush includes a colored stamp (the first colored stamp).
[0266] In some embodiments, the first color may be a drawing color selected by the user, such as the color selected by the user in the color control U12 shown in Figure 2B. In this case, the generated ink may include one or more second color stamps.
[0267] For example, if the first brush is brush B1, the first color stamp is the aforementioned color stamp CB1, and the first color is the color shown in Figure 3A with a hue of 0°, a saturation of 81%, and a brightness of 100%, the electronic device can fuse the first color and the colors of each pixel in the color stamp CB1 to obtain the aforementioned fused color stamp CB1' (as the second color stamp), and repeatedly draw at least one fused color stamp CB1' along the drawing trajectory corresponding to the user's drawing operation (e.g., the aforementioned drawing trajectory L1) to obtain the aforementioned color ink mark IK2.
[0268] In some embodiments, the first color may also be a color determined by an electronic device (e.g., a color determined based on a random algorithm or stylus parameters), or a drawing color selected by the user, or a color determined by the electronic device based on a drawing color selected by the user (e.g., a color obtained by adjusting one or more of the hue, saturation, and brightness of the drawing color), or a color determined by the electronic device based on the content of the first color stamp (e.g., the main subject in the first color stamp, the main color in the first color stamp, etc.).
[0269] In some embodiments, the electronic device can fuse multiple blended colors (including a first color) with a first color stamp to obtain multiple blended color stamps, and then repeatedly draw these multiple blended color stamps along the drawing trajectory corresponding to the drawing operation to obtain colored ink. The multiple colors can be colors determined by the electronic device based on a random algorithm or stylus parameters, colors selected by the user, or colors determined by the electronic device based on the drawing colors selected by the user.
[0270] For example, in addition to generating the second color stamp described above, the electronic device can also fuse the second color with the colors of each pixel in the first color stamp to obtain a third color stamp. Furthermore, during the process of generating and displaying the color ink corresponding to the drawing operation, the electronic device can repeatedly draw at least one first color stamp and at least one second color stamp along the drawing trajectory corresponding to the drawing operation to obtain the color ink. That is, the generated color ink may include at least one first color stamp and at least one second color stamp repeatedly drawn along the drawing trajectory.
[0271] For example, when the first brush is brush B1 and the first color stamp is the aforementioned color stamp CB1, in addition to the fused color stamp CB1', the electronic device can also fuse the second color shown in FIG3C with the color of each pixel in the color stamp CB1 to obtain a fused color stamp CB1″ (as a third color stamp), and repeatedly draw at least one fused color stamp CB1' and at least one fused color stamp CB1″ along the user's drawing trajectory (e.g., the aforementioned trajectory L1) to obtain the aforementioned color ink mark IK3.
[0272] It should be noted that in some other embodiments, the generated colored ink may also include a fused colored stamp obtained by fusing more blended colors with the colors of each pixel of the first colored stamp, which is not limited here.
[0273] In some embodiments, when the second and third color stamps are repeatedly drawn along the drawing trajectory of the user's drawing operation, at least one stamp parameter (e.g., stamp size, stamp opacity, stamp angle, stamp scattering, stamp spacing, stamp roundness, stamp hue, stamp brightness, stamp saturation, etc.) of at least one of the second and third color stamps can change with changes in stylus parameters (e.g., stylus tilt angle, stylus rotation angle, stylus pressure, etc.) (or can change randomly). For example, one or more stamp parameters of the second and third color stamps can increase or decrease with increases in stylus tilt angle, stylus rotation angle, or stylus pressure.
[0274] It should be noted that the method of blending the first color or the second color with the colors of each pixel in the first color stamp can refer to the aforementioned method of blending the first pixel and the second pixel, and will not be repeated here.
[0275] It should be noted that during the process of the user drawing the trajectory, the electronic device can repeatedly draw the second color stamp and / or the third color stamp along the drawing trajectory one by one, and display multiple frames of ink images including parts of the second color stamp and / or the third color stamp. After the user finishes drawing the trajectory (for example, when the user's finger / stylus leaves the screen of the electronic device, or when the user's finger / stylus stops at a certain position on the screen of the electronic device), the colored ink corresponding to the drawing trajectory is obtained.
[0276] The following describes how an electronic device generates and displays the corresponding colored ink marks when the first brush stroke includes multiple colored stamps.
[0277] In some embodiments, the first brush may include multiple color stamps (equivalent to enabling the multi-brush function of the first brush). In this case, the electronic device may blend one or more blend colors with the multiple color stamps respectively to obtain one or more blended color stamps corresponding to each color stamp. Then, during the generation of colored ink, the electronic device may repeatedly draw the blended color stamps corresponding to each color stamp along the user's drawing trajectory to obtain colored ink.
[0278] It should be noted that the various colored stamps in the first brush stroke can be colored stamps stored in the electronic device, colored stamps obtained by the electronic device from other devices (such as servers), or colored stamps generated based on the image selected by the user; there are no restrictions here.
[0279] For example, in addition to the aforementioned first color stamp, the first brush may also include a fourth color stamp. During the process of generating and displaying the color ink mark corresponding to the drawing operation, the electronic device can merge the first color with the first color stamp to obtain a second color stamp, merge the fifth color with the fourth color stamp to obtain a fifth color stamp, and repeatedly draw at least one second color stamp and at least one fifth color stamp along the user's drawing trajectory to obtain the color ink mark.
[0280] For example, when the first brush is brush B1, the first color stamp is the aforementioned color stamp CB1, and the fourth color stamp is the aforementioned color stamp CB2, the electronic device can also fuse the fifth color shown in FIG4A with the colors of each pixel in the color stamp CB2 to obtain a fused color stamp CB2' (as the fifth color stamp), and repeatedly draw at least one fused color stamp CB2' and at least one fused color stamp CB2' along the user's drawing trajectory (e.g., the aforementioned trajectory L1) to obtain the aforementioned color ink mark IK4.
[0281] For example, in addition to the aforementioned first color stamp, the first brush stroke may also include a fourth color stamp. During the process of generating and displaying the color ink corresponding to the drawing operation, the electronic device may fuse the first color with the first color stamp to obtain a second color stamp, fuse the second color with the first color stamp to obtain a third color stamp, and fuse the fifth color with the fourth color stamp to obtain a fifth color stamp. At least one second color stamp, at least one third color stamp, and at least one fifth color stamp are then repeatedly drawn along the user's drawing trajectory to obtain the color ink. In this case, the color ink may include at least one second color stamp, at least one third color stamp, and at least one fifth color stamp.
[0282] For example, when the first brush is brush B1, the first color stamp is the aforementioned color stamp CB1, and the fourth color stamp is the aforementioned color stamp CB2, the electronic device can repeatedly draw at least one blended color stamp CB1', at least one blended color stamp CB1″, and at least one blended color stamp CB2' along the user's drawing trajectory (e.g., the aforementioned trajectory L1) to obtain the aforementioned color ink mark IK5.
[0283] In some embodiments, the fifth color may be a color selected by the user (e.g., the drawing color selected by the user for the color stamp CB2 in the aforementioned color control U27), a color randomly determined by the electronic device, or a color determined by the electronic device based on the stylus parameters of the stylus.
[0284] In some embodiments, the fifth color and the first color may be the same or different.
[0285] It should be noted that the method of blending the fifth or sixth color with the colors of each pixel in the second color stamp can refer to the aforementioned method of blending the first and second pixels, and will not be repeated here.
[0286] In some embodiments, when the first brush includes multiple color stamps, the hue, saturation, brightness, etc., of the blending color used to generate the blended color stamp corresponding to the color stamp can be dynamically changed. That is, the generated color ink may include one or more blended color stamps corresponding to the color stamps, and the blended color stamp corresponding to each color stamp may include one or more blended color stamps obtained by blending one or more blending colors with the color stamps respectively.
[0287] For example, when the color stamp of the first brush includes a first color stamp and a fourth color stamp, the electronic device, in the process of generating and displaying the color ink corresponding to the drawing operation, can fuse the first color with the first color stamp to obtain a second color stamp, fuse the second color with the first color stamp to obtain a third color stamp, fuse the fifth color with the fourth color stamp to obtain a fifth color stamp, and fuse the sixth color with the fourth color stamp to obtain a sixth color stamp. At least one second color stamp, at least one third color stamp, at least one fifth color stamp, and at least one sixth color stamp are then repeatedly drawn along the user's drawing trajectory to obtain the color ink. In this case, the color ink may include at least one second color stamp, at least one third color stamp, at least one fifth color stamp, and at least one sixth color stamp.
[0288] For example, when the first brush is brush B1, the first color stamp is the aforementioned color stamp CB1, and the fourth color stamp is the aforementioned color stamp CB2, in addition to merging color stamps CB1', CB1″, and CB2', the electronic device can also merge the sixth color with color stamp CB2 to obtain merging color stamp CB2″, and repeatedly draw merging color stamps CB1', CB1″, CB2', and CB2″ along the user's drawing trajectory to obtain the color ink mark IK7 shown in Figure 11A.
[0289] It should be noted that, in some embodiments, the order, number, and spacing of the second, third, fifth, and sixth color stamps can vary randomly during the repeated drawing process along the drawing trajectory. In other embodiments, the order, number, and spacing of the second, third, fifth, and sixth color stamps can be fixed during the repeated drawing process along the drawing trajectory. This application does not impose any limitations on this.
[0290] In some embodiments, the second and fifth color stamps may have an overlapping area in the generated color ink. The color of each pixel in the overlapping area can be obtained by mixing the pixel values of each color channel in the RGB model of the pixels in the overlapping area of the second color stamp with the pixel values of each color channel in the RGB model of the fifth color stamp. Exemplarily, the mixing mode of the overlapping area may include, but is not limited to, Normal, Multiply, Darken, Color Burn, Linear Burn, Color Dodge, Difference, Subtract, and Overlay. Optionally, the mixing mode of the overlapping area can be the mixing mode selected by the user in the mixing mode control U24 of the aforementioned multi-brush options. The mixing mode of the overlapping area of the second and fifth color stamps is described below.
[0291] Color blending mode 1 (normal): In normal color blending mode, the overlapping area of the second and fifth color stamps retains the color of the second color stamp and removes the color of the fifth color stamp.
[0292] Color blending mode 2 (Multiply): In the Multiply blending mode, the third pixel in the second color stamp overlaps with the fourth pixel in the fifth color stamp. The color of the fifth pixel after the third and fourth pixels overlap can be expressed as the following formula (12): [R3, G3, B3] = [R1×R2, G1×G2, B1×B2] / A (12)
[0293] In formula (12), R1, G1, and B1 represent the pixel values of the fourth pixel in the red, green, and blue channels of the RGB model, respectively; R2, G2, and B2 represent the pixel values of the third pixel in the red, green, and blue channels of the RGB model, respectively; R3, G3, and B3 represent the pixel values of the fifth pixel in the red, green, and blue channels of the RGB model, respectively; and A is the maximum value of the pixel values of the red, green, and blue channels (for example, when the pixel values of each color channel are represented by 8 bits of binary, A = 255; when the pixel values of each color channel are represented by 10 bits of binary, A = 1023).
[0294] It should be noted that the definitions of R1, G1, B1, R2, G2, B2, R3, G3, B3, and A in formula (12) also apply to formulas (13) to (18) below, and will not be repeated below.
[0295] Color blending mode three (darkening): In darkening color blending mode, the pixel values of the red, green, and blue channels in the RGB model of the fifth pixel can be the minimum values of the red, green, and blue channels of the third and fourth pixels in the RGB model, respectively. For example, the color of the fifth pixel can be expressed as the following formula (13): [R3, G3, B3] = [min(R1, R2), min(R1, R2), min(R1, R2)] (13)
[0296] In formula (13), min() means finding the minimum value.
[0297] Color blending mode four (color burn): In color burn blending mode, the color of the fifth pixel can be represented by the following formula (14): [R3, G3, B3]=[(A-R1)×(A-R2) / R1,(A-G1)×(A-G2) / G1,(A-G1)×(A-G2) / G1)] (14)
[0298] In formula (14), when (A-R1)×(A-R2) / R1 is greater than A, R3 is A; when (A-G1)×(A-G2) / G1 is greater than A, G3 is A; when (A-B1)×(A-B2) / B1 is greater than A, B3 is A.
[0299] Color blending mode 5 (linear burn): In linear burn color blending mode, the color of the fifth pixel can be represented by the following formula (15): [R3, G3, B3]=[R1+R2-R1×R2 / A,G1+G2-G1×G2 / A,B1+B2-B1×B2 / A] (15)
[0300] Color blending mode six (color dodge): In color dodge blending mode, the color of the fifth pixel can be represented by the following formula (16): [R3, G3, B3]=[R1+R1×R2 / (A-R2), G1+G1×G2 / (A-G2), B1+B1×B2 / (A-B2)] (16)
[0301] In formula (16), when R1+R1×R2 / (A-R2) is greater than A, R3 is A; when G1+G1×G2 / (A-G2) is greater than A, G3 is A; when B1+B1×B2 / (A-B2) is greater than A, B3 is A.
[0302] Color Mixing Mode 7 (Difference): In difference color mixing mode, the color of the fifth pixel can be represented by the following formula (17): [R3, G3, B3] = [abs(R1-R2), abs(G1-G2), abs(B1-B2)] (17)
[0303] In formula (17), abs() represents the absolute value.
[0304] Color blending mode eight (subtractive): In subtractive color blending mode, the color of the fifth pixel can be represented by the following formula (18): [R3, G3, B3] = [max(R2-R1,0), max(R2-R1,0), max(R2-R1,0)] (18)
[0305] In formula (18), max() means to find the maximum value.
[0306] Color blending mode nine (overlay): In overlay color blending mode, the overlapping area of the second and fifth color stamps retains the color of the fifth color stamp and removes the color of the second color stamp.
[0307] In some embodiments, the color mixing of pixels in the overlapping area of the second and fifth color stamps can also be based on the fusion of the first pixel and the first color. For example, when the fifth color stamp is superimposed on the second color stamp, the color mixing of the fourth pixel of the fifth color stamp and the third pixel of the second color stamp to obtain the color of the fifth pixel can be achieved by fusing the first color (equivalent to the color of the fourth pixel) and the third color of the first pixel (equivalent to the color of the fifth pixel) using fusion method one to fusion method four. Specifically, the hue of the fifth pixel can be the same as the hue of the fourth pixel, the saturation of the fifth pixel can be determined based on the saturation of the third pixel and / or the saturation of the fourth pixel, and the brightness of the fifth pixel can be determined based on the brightness of the third pixel and / or the brightness of the fourth pixel. For details, please refer to the aforementioned fusion methods one to four, which will not be elaborated upon here.
[0308] It should be noted that the above-mentioned color mixing modes one through nine are merely examples. In other embodiments, more color mixing modes may be included, which are not limited here. For example, color mixing modes may also include dissolve color mixing mode, dark color mixing mode, lighten color mixing mode, filter color mixing mode, linear dodge color mixing mode, light color mixing mode, soft light color mixing mode, hard light color mixing mode, bright light color mixing mode, linear light color mixing mode, point light color mixing mode, solid color mixing mode, exclusion color mixing mode, division color mixing mode, hue color mixing mode, saturation color mixing mode, color mixing mode, and brightness color mixing mode, etc.
[0309] Through the above color mixing modes, electronic devices can directly generate ink marks obtained by blending different color stamps when the user draws a drawing trajectory, which helps to improve the user experience.
[0310] In some embodiments, the areas where the second and sixth color stamps overlap, the areas where the third and fifth color stamps overlap, and the areas where the third and sixth color stamps overlap can also be mixed based on the above-described color mixing mode.
[0311] In some embodiments, for areas where the same blended color stamp is superimposed, color blending can also be performed using the above-described color blending mode (the blended color stamp on the upper layer is equivalent to the fifth color stamp, and the blended color stamp on the lower layer is equivalent to the second color stamp).
[0312] In some embodiments, when the second, third, five-color, and sixth color stamps are repeatedly drawn along the drawing trajectory of the user's drawing operation, at least one stamp parameter (e.g., stamp size, stamp opacity, stamp angle, stamp scattering, stamp spacing, stamp roundness, stamp hue, stamp brightness, stamp saturation, etc.) of at least one of the second, third, fifth, and sixth color stamps can change with changes in stylus parameters (e.g., stylus tilt angle, stylus rotation angle, stylus pressure, etc.) (or may change randomly). For example, one or more stamp parameters of the second, third, five-color, and sixth color stamps can increase or decrease with increases in stylus tilt angle, stylus rotation angle, or stylus pressure.
[0313] The following examples, using stamp size and stamp opacity as examples, illustrate how the stamp parameters of the second-color stamp, third-color stamp, fifth-color stamp, and sixth-color stamp change when repeatedly drawn along the drawing trajectory of the user's drawing operation.
[0314] Stamp size change
[0315] When the size jitter function of the first colored stamp is enabled (e.g., when the size jitter value in the aforementioned jitter control is not 0), the size of the second and third colored stamps can change randomly during repeated drawing along the drawing trajectory. When the size jitter function of the fourth colored stamp is enabled (e.g., when the size jitter value in the aforementioned jitter control is not 0), the size of the fifth and sixth colored stamps can change randomly during repeated drawing along the drawing trajectory. When the size parameter value in the pressure follow control corresponding to the first colored stamp is not 0, the size of the second and third colored stamps can change with the stylus pressure during repeated drawing along the drawing trajectory (e.g., increasing with increasing stylus pressure, or decreasing with increasing stylus pressure). When the size parameter value in the corner follow control corresponding to the fourth color stamp is not 0, the size of the fifth and sixth color stamps can change with the change of the stylus angle during the repeated drawing process along the drawing trajectory (for example, it can increase or decrease as the stylus angle increases).
[0316] For example, referring to Figure 11B, in the case shown in Figure 11A, when the size jitter function of the color stamp CB1 is enabled, the sizes of the merged color stamps (merged color stamp CB1', merged color stamp CB1″) corresponding to the color stamp CB1 in the generated color ink IK7-1 vary randomly. The sizes of the three merged color stamps CB1″ and the two merged color stamps CB1' in the color ink IK7-1 are different from those in the color ink IK7-1 shown in Figure 11A.
[0317] For example, referring to Figure 11C, in the case shown in Figure 11A, in the color ink IK7-2 generated when the pressure parameter value in the pressure follow control corresponding to the color stamp CB1 is not 0, the size of the fused color stamps (fused color stamp CB1', fused color stamp CB1″) corresponding to the color stamp CB1 changes with the stylus pressure. During the drawing of trajectory L1, the stylus pressure at the position drawn by the fused color stamp CB1' is 1.2N, and the stylus pressure at the position drawn by the fused color stamp CB1″ is 0.8N. In the color ink IK7-2, the three fused color stamps CB1″ have the same size, the two fused color stamps CB1' have the same size, and the fused color stamps CB1″ and fused color stamp CB1' have different sizes.
[0318] Stamp opacity change
[0319] With the opacity jitter function of the first colored stamp enabled (e.g., when the opacity jitter value in the aforementioned jitter control is not 0), the opacity of the second and third colored stamps can change randomly during repeated drawing along the drawing path. With the opacity function of the fourth colored stamp enabled (e.g., when the opacity jitter value in the aforementioned jitter control is not 0), the opacity of the fifth and sixth colored stamps can change randomly during repeated drawing along the drawing path. When the opacity parameter value in the tilt angle follow control corresponding to the first colored stamp is not 0, the opacity of the second and third colored stamps can change with the stylus tilt angle during repeated drawing along the drawing path (e.g., increasing with increasing stylus tilt angle, or decreasing with increasing stylus tilt angle). When the opacity parameter value in the pressure follow control corresponding to the fourth color stamp is not 0, the opacity of the fifth and sixth color stamps can change with the stylus pressure during the repeated drawing process along the drawing trajectory (for example, it increases with the increase of stylus pressure, or decreases with the increase of stylus pressure).
[0320] Based on the method shown in Figure 10, electronic devices can generate ink marks by blending different fusion colors (e.g., the first color, the second color, the fifth color, the sixth color, etc.) with the color stamps of the first brush (e.g., the first color stamp, the fourth color stamp, etc.). These fusion color stamps are then repeatedly drawn along the drawing trajectory to meet the user's personalized drawing needs. Furthermore, during the repeated drawing process along the drawing trajectory, the stamp parameters can change randomly or according to the stylus parameters, allowing the electronic device to generate ink marks with more varied and richer forms.
[0321] Below, we introduce a software architecture applicable to the ink generation method provided in the embodiments of this application.
[0322] For example, FIG12 illustrates a schematic diagram of a software architecture according to some embodiments of the present application.
[0323] As shown in Figure 12, the software architecture of an electronic device can be a layered architecture, which may include, for example, an application layer, a framework layer, a service layer, and a kernel layer.
[0324] The application layer can include applications in electronic devices, such as drawing applications.
[0325] In some embodiments, a painting application may include an interaction module, a brush engine, a rendering engine, etc.
[0326] The interaction module is used to input touch information from the subsystem to interact with the user. For example, the interaction module can be used to obtain the controls or positions affected by the user's touch operations (click, swipe, zoom, etc.) on the user interface; the interaction module can also determine the brush parameters configured by the user (such as the parameters of each editing option in the aforementioned brush editing interface), the brush parameters of the color brush selected by the user, the drawing color, the drawing trajectory, the stylus parameters, and other information based on the touch information, and pass them to the brush engine.
[0327] The brush engine can call the CPU and GPU through the graphics subsystem, graphics processing unit (GPU) driver, central processing unit (CPU) driver, etc. to process the color image selected by the user into a color stamp, blend the color stamp of the color brush with the blend color to obtain a blended color stamp, obtain the rendering data corresponding to the color ink based on the blended color stamp and brush parameters (such as the image of the blended color stamp, the drawing position of the blended color stamp on the drawing trajectory, the stamp parameters of the blended color stamp at each drawing position, etc.), and pass the rendering data to the rendering engine.
[0328] The rendering engine is used to render the colored ink by calling the GPU based on the rendering data corresponding to the colored ink through the graphics subsystem, GPU driver, etc.
[0329] In some embodiments, the interaction module, brush engine, and rendering engine can exchange data through the Java Native Interface (JNI).
[0330] The framework layer provides application programming interfaces (APIs), programming frameworks, and capability frameworks for the application. The service layer is a collection of operating system capabilities used to provide services to the application through the framework layer.
[0331] In some embodiments, the framework layer and service layer may include subsystems for implementing relevant functions in an electronic device, such as an input subsystem, a graphics subsystem, etc.
[0332] The input subsystem is used to acquire touch information such as the user's touch position and touch pressure on the touch sensor through the touch chip driver, and to acquire stylus parameters (such as stylus pressure, stylus tilt angle, stylus rotation angle, etc.) transmitted by the stylus through the stylus flash driver (or other wireless communication driver, such as Bluetooth driver, wireless LAN driver, etc.), and then pass the acquired stylus parameters to the drawing application.
[0333] The graphics subsystem is used to generate color stamps, blend color stamps and color ink marks based on the calls to the brush engine and rendering engine, and to display the color stamps and blend color stamps on the display screen through the display chip driver.
[0334] In other embodiments, the framework layer and service layer may include more or fewer modules, which is not limited here.
[0335] The kernel layer includes the operating system kernel (not shown) and drivers for the electronic device's hardware, such as drivers for touch chips, styluses, GPUs, CPUs (not shown), and display chips. Modules in the drawing application or framework / service layer can use these hardware drivers to invoke hardware functions. For example, a touch chip driver can be used to acquire touch information from the user on the touch sensor; a stylus driver is used to communicate with other devices based on the stylus (e.g., to acquire stylus parameters); a GPU driver can be used to invoke the GPU to implement graphics processing functions; and a display chip driver can be used to drive the display screen to show images.
[0336] In other embodiments, the kernel layer may also include more or fewer modules, which is not limited here.
[0337] In other embodiments, the software architecture of the electronic device may include more or fewer layers, or may employ other architectures, which are not limited herein.
[0338] The technical solution of this application will be introduced below with reference to the software architecture shown in Figure 12.
[0339] For example, Figure 13 illustrates a process diagram of a painting application implementing the aforementioned ink generation method according to some embodiments of this application. The subject executing this method can be an electronic device, such as a painting application in an electronic device. As shown in Figure 13, the process includes:
[0340] S1301, the interaction module detects that the user has selected a colored brush and sends the brush parameters of the colored brush to the brush engine.
[0341] When the interaction module detects that a colored brush (such as the aforementioned first brush, brush B1) has been selected, it can send the brush parameters of the colored brush selected by the user to the brush engine.
[0342] In some embodiments, brush parameters may include one or more of the following parameters: brush stamp, stamp parameters of each stamp of the brush (e.g., stamp size, stamp roundness, stamp direction, stamp spacing or stamp density, stamp opacity, stamp blending mode (blending mode of the stamp with the background or other content on the screen)), and stamp function options (e.g., parameters in the aforementioned size jitter, opacity jitter, pressure roundness, tilt roundness, corner roundness, color jitter, pressure color, tilt color, corner color, multiple brushes, blending mode of multiple brushes, and parameters in the pressure follow / tilt follow / corner follow function options in the stylus options).
[0343] For example, when the interaction module detects that the user has selected the aforementioned brush B1 operation, it can send the brush parameters of brush B1 to the brush engine.
[0344] In some embodiments, the brush parameters may further include a brush flag indicating whether the brush is a colored brush. For example, when the aforementioned color control U20 is enabled, the brush flag corresponding to brush B1 may indicate the use of a colored stamp CB1; when the aforementioned color control U20 is disabled, the brush flag corresponding to brush B1 may indicate the use of a grayscale stamp corresponding to the colored stamp CB1. When the brush flag indicates that the brush stamp is a colored brush, the electronic device can generate ink marks based on the method of the embodiments of this application.
[0345] S1302, the interaction module detects the user's drawing operation and sends drawing information to the brush engine.
[0346] After receiving touch information from the input subsystem, the interaction module can determine drawing information based on the touch information and send the drawing information to the brush engine. In some embodiments, the drawing information may include a drawing trajectory and stylus parameters corresponding to at least some positions on the drawing trajectory.
[0347] For example, during the process of a user drawing ink marks on the touchscreen of an electronic device using a stylus, the stylus can transmit a marking signal to the touchscreen as long as the pen tip touches the touchscreen. The touch chip driver can obtain touch information (such as touch position (indicating the position where the stylus is in contact with the touchscreen), touch pressure (indicating the pressure applied by the user when drawing with the stylus)) based on the marking signal and changes in electrical signals (such as changes in capacitance, inductance, voltage, and current) detected by the device's detection circuit on the touchscreen, and send the touch information to the input subsystem. The stylus can also send the stylus parameters detected in the stylus (such as stylus pressure, stylus tilt angle, stylus rotation angle, etc.) to the electronic device via wireless communication methods such as StarFlash, and the StarFlash driver in the electronic device will then transmit them to the input subsystem. The input subsystem can then transmit the touch information to the interaction module of the drawing application. Secondly, the interaction module can obtain the drawing trajectory based on the touch position (for example, the interaction module can obtain the drawing trajectory drawn by the user based on anomaly detection, filtering, curve fitting (such as spline curve fitting) of the touch position), and send the drawing trajectory and the stylus parameters at different positions on the drawing trajectory to the brush engine.
[0348] In some embodiments, the interaction module can also send the drawing color selected by the user to the brush engine.
[0349] It should be noted that in some embodiments, the interaction module can directly transmit touch information to the brush engine, which then determines the drawing trajectory.
[0350] It should be noted that in some embodiments, steps S1301 and S1302 can also be combined into one step. In this case, the interaction module can send drawing information and brush parameters to the brush engine upon detecting the user's drawing operation.
[0351] S1303, the brush engine generates rendering data for colored ink based on drawing information, blended colors, and brush parameters, and sends the rendering data to the rendering engine.
[0352] After receiving the drawing information, the brush engine calls the GPU (e.g., the shader running on the GPU) to blend the color (e.g., the color selected by the user, a randomly generated color, or a color determined based on the stylus parameters) with the color stamp of the colored brush, resulting in an image with a blended color stamp. Then, the brush engine obtains the rendering data of the colored ink based on the brush parameters (and / or stylus parameters) (e.g., the image with the blended color stamp, the drawing position of the blended color stamp on the drawing trajectory, and the stamp parameters of the blended color stamp drawn at different drawing positions).
[0353] In some embodiments, the brush engine may also invoke the GPU (e.g., invoke a shader running in the GPU) to blend the color stamp with a user-configured grain texture (e.g., texture W1 shown in FIG8B) and a blend color (e.g., blend the blend color with the color stamp CB3 shown in FIG8B) to obtain a blended color stamp.
[0354] In some embodiments, the blending color (e.g., the aforementioned first color, fifth color) can be the drawing color selected by the user on the color control. When the colored brush has multiple colored stamps, the electronic device can configure the same or different drawing colors for each of the multiple colored stamps based on the user's selection.
[0355] In some embodiments, the blended colors (such as the aforementioned first, second, fifth, and sixth colors) may also be colors randomly generated by the electronic device (or randomly generated based on the drawn colors). For example, if at least one parameter value in the color dithering control is not 0, the electronic device may randomly generate one or more blended colors.
[0356] In some embodiments, the blended colors (such as the aforementioned first, second, fifth, and sixth colors) can be generated by the electronic device based on stylus parameters. For example, the brush engine can invoke the CPU to generate the blended colors.
[0357] For example, if at least one parameter value in the pressure color control is not 0, the electronic device can generate a color sequence including multiple colors, where each color in the color sequence can correspond to a pressure value (or pressure range). Based on the stylus pressure at the drawing position on the drawing trajectory, the electronic device can use the color in the color sequence corresponding to the stylus pressure as the blend color for the blended color stamp at that drawing position.
[0358] For example, if at least one parameter value in the tilt color control is not 0, the electronic device can generate a color sequence including multiple colors, where each color in the color sequence can correspond to an angle value (or a range of angle values). Based on the pen tilt angle at the drawing position on the drawing trajectory, the electronic device can use the color in the color sequence corresponding to the pen tilt angle as the blend color for the blend color stamp at that drawing position.
[0359] For example, if at least one parameter value in the corner color control is not 0, the electronic device can generate a color sequence containing multiple colors, where each color in the color sequence can correspond to an angle value (or an angle value range). Based on the stylus angle at the drawing position on the drawing trajectory, the electronic device can use the color in the color sequence corresponding to the stylus angle as the blend color for the blended color stamp at that drawing position.
[0360] In some embodiments, when the color jitter, pressure color, tilt color, and corner color functions of a certain color stamp in a color brush are not enabled, the color stamp may correspond to only one blend color (e.g., the drawing color selected by the user for the color stamp). Optionally, this blend color may be a color sent to the brush engine by the interaction module.
[0361] It should be noted that the way the brush engine blends the blend color with the color stamp to obtain the blended color stamp can be referred to as the aforementioned blending method of blending the first color with the first color stamp to obtain the second color stamp, which will not be repeated here.
[0362] In some embodiments, for the same blended color stamp, the stamp parameters can be the same or different when drawn at different drawing positions. For example, when the size jitter function of a color stamp is enabled (e.g., the size jitter value is not 0), the size of the color stamp can be different when drawn at different drawing positions; when the pressure roundness function of a color stamp is enabled (e.g., the parameter value in the pressure roundness control is not 0), the roundness of the color stamp when drawn at different drawing positions can change with the stylus pressure; when the opacity parameter value in the tilt follow control of a color stamp is not 0, the opacity of the color stamp when drawn at different drawing positions can change with the stylus tilt angle.
[0363] S1304, the rendering engine generates and displays colored ink marks based on rendering data.
[0364] After receiving the rendering data, the rendering engine can use the GPU to draw the image with the fused color stamp at the corresponding drawing position, generate color ink marks, and display the color ink marks through the display driver chip.
[0365] For example, when drawing a blended color stamp at a specific redrawing position, the rendering engine can adjust the blended color stamp based on the stamp parameters corresponding to that position and then draw the adjusted blended color stamp at that position. For example, if the stamp size at a certain drawing position is 120% (1.2 times the original size of the blended color stamp), the electronic device can first enlarge the blended color stamp to 1.2 times its original size before drawing the enlarged blended color stamp at that position. As another example, if the rotation angle at a certain drawing position is 100°, the electronic device can first rotate the blended color stamp 100° clockwise or counterclockwise before drawing the rotated blended color stamp at that position.
[0366] Based on the above method, electronic devices can merge a blended color with a colored brush to obtain a blended colored stamp, and then repeatedly draw along the drawing trajectory to obtain colored ink marks, which can meet the user's need to draw colored stamps of different colors. Furthermore, since the stamp parameters can dynamically change when the blended colored stamp is drawn at different drawing positions, a single colored ink mark can include multiple blended colored stamps with different stamp parameters, further enriching the diversity of the generated colored ink marks.
[0367] It should be noted that the ink generation method provided in this application embodiment can be applied to any electronic device, including but not limited to electronic drawing boards, electronic blackboards, smart screens, mobile phones, smart TVs, wearable devices, laptops, tablets, industrial control devices, autonomous driving devices (such as vehicle systems), terminal devices in smart grids, terminal devices in transportation safety, terminal devices in smart cities, terminal devices in smart homes (such as whole-house smart hosts), and so on.
[0368] For example, FIG14 illustrates a hardware structure diagram of an electronic device 10 according to an embodiment of the present application. The electronic device 10 can be used to implement the ink generation method provided in the embodiments of the present application.
[0369] As shown in Figure 14, the electronic device 10 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0370] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 10. In other embodiments of this application, the electronic device 10 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0371] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, GPUs, image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0372] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0373] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the aforementioned memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0374] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 10, and can also be used for data transfer between electronic device 10 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.
[0375] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 10. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.
[0376] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.
[0377] The wireless communication function of electronic device 10 can be implemented through antenna 1, wireless communication module 160, modem processor and baseband processor, etc.
[0378] Antenna 1 is used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 10 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in conjunction with a tuning switch.
[0379] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 10, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), and near link (NL). The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The aforementioned GNSS can include global positioning system (GPS), global navigation satellite system (GLONASS), BeiDou navigation satellite system (BDS), quasi-zenith satellite system (QZSS), and / or satellite-based augmentation systems (SBAS).
[0380] The wireless communication module 160 receives electromagnetic waves via antenna 1, performs frequency modulation and filtering of the electromagnetic wave signal, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 1.
[0381] In some embodiments, the wireless communication module 160 can be used to communicate with other devices (e.g., a stylus) to obtain stylus parameters such as stylus pressure, stylus tilt angle, and stylus rotation angle.
[0382] Electronic device 10 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0383] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini-LED, a Micro-LED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 10 may include one or N display screens 194, where N is a positive integer greater than 1. In some embodiments, the display screen 194 can be used to display the aforementioned first ink mark and second ink mark.
[0384] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 10 may include one or N cameras 193, where N is a positive integer greater than 1.
[0385] Video codecs are used to compress or decompress digital video. Electronic device 10 may support one or more video codecs. Thus, electronic device 10 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.
[0386] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 10. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0387] Internal memory 121 can be used to store computer executable program code, including instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as the aforementioned drawing application), etc. The data storage area may store data created during the use of electronic device 10 (color stamps of colored brushes, color images, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of electronic device 10 by running instructions stored in internal memory 121 and / or instructions stored in memory located within the processor.
[0388] Electronic device 10 can implement audio functions such as music playback and recording through audio module 170, speaker 170A, receiver 170B, microphone 170C, and application processor.
[0389] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.
[0390] Speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. Electronic device 10 can listen to music or make hands-free calls through speaker 170A. Receiver 170B, also known as a "handset," is used to convert audio electrical signals into sound signals. Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals.
[0391] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 10 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 10 detects the intensity of the touch operation (as the pressure of the user-drawn trajectory) based on pressure sensor 180A. Electronic device 10 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands.
[0392] In some embodiments, the pressure sensor 180A can be used to detect the touch pressure exerted by a user's finger or stylus on the touch sensor 180K.
[0393] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 10.
[0394] The accelerometer 180E can detect the magnitude of acceleration of electronic device 10 in various directions (generally three axes).
[0395] Touch sensor 180K, also known as a "touch device," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touchscreen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event, allowing the application processor to obtain touch information (e.g., touch location) from the user using a stylus, finger, etc. In some embodiments, touch sensor 180K may also be located on the surface of electronic device 10, in a different position than display screen 194.
[0396] In some embodiments, when a stylus, a user's finger, or other object approaches or touches the touch sensor 180K, the electrical signals (e.g., capacitance, inductance, voltage, current) in the area touched by the stylus or user's finger change. The touch sensor 180K can determine the location touched by the stylus or user's finger based on this change in electrical signal and transmit the location to the processor 110. The processor 110 can obtain the drawing trajectory drawn by the user based on the location touched by the stylus or user's finger, and obtain the aforementioned colored ink mark by repeatedly drawing along the drawing trajectory with a fused color stamp.
[0397] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. The electronic device 10 can receive button input and generate key signal inputs related to user settings and function control of the electronic device 10.
[0398] Motor 191 can generate vibration alerts.
[0399] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.
[0400] It should be noted that the structure of the electronic device 10 shown in the foregoing embodiments is only an example. In other embodiments, the electronic device may include more or fewer modules, or some modules may be merged or split, which is not limited here.
[0401] For example, FIG15 shows a schematic diagram of the hardware structure of a stylus 20 according to an embodiment of the present application. The stylus 20 can be used to draw trajectories on the electronic device 10 and to transmit stylus parameters to the electronic device 10.
[0402] Referring to Figure 15, the stylus 20 may include a processor 210, a memory 220, a sensor module 230, one or more electrodes 240, a sensing circuit 250, a wireless communication module 260, and a power supply module 270.
[0403] The processor 210 can be used to execute instructions to perform related functions, such as detecting stylus parameters. The processor 210 can be a microprocessor, microcontroller, digital signal processor, application-specific integrated circuit, etc.
[0404] The memory 220 is used to store data or instructions.
[0405] Sensor module 230 may include one or more sensors. For example, the sensors may include pressure sensors and inertial sensors.
[0406] Pressure sensors can be used to detect the pressure applied by a stylus. For example, when one end of the stylus tip 20 is subjected to force, the other end of the tip can apply the force to the pressure sensor.
[0407] The inertial sensor may include a three-axis accelerometer and a three-axis gyroscope, and / or other components for measuring the motion of the stylus 20. The inertial sensor can be used to acquire acceleration data of the stylus, and the processor 210 can determine stylus parameters such as stylus rotation angle and stylus tilt angle based on the acceleration data.
[0408] Electrode 240 can be disposed on the tip of stylus 20 for coupling with touch sensors of other devices (such as the aforementioned touch sensor 180K) to form a coupling capacitor.
[0409] The sensing circuit 250 can be used to acquire the capacitance value of the coupling capacitance between the electrode 240 and the touch sensor of another device. Exemplarily, the sensing circuit 250 may include an amplifier for receiving capacitance readings from the capacitive touch sensor panel, a clock for generating a demodulated signal, a phase shifter for generating a phase-shifted demodulated signal, a mixer for demodulating the capacitance reading using in-phase demodulation frequency components, and a mixer for demodulating the capacitance reading using quadrature demodulation frequency components. The result of the mixer demodulation can be used to determine an amplitude proportional to the capacitance, allowing the stylus 20 to detect contact with the capacitive touch sensor panel.
[0410] The wireless communication module 260 is used for communication between the stylus 20 and other devices. For example, the wireless communication module 260 may include processing circuitry for communication solutions such as Wi-Fi, Wi-Fi, and Bluetooth. The wireless communication module 260 can be used to transmit stylus parameters (such as stylus pressure, stylus tilt angle, stylus rotation angle, etc.) to other devices (such as electronic device 10).
[0411] The power supply module 270 is used to supply power to the various modules of the stylus 20.
[0412] It should be noted that the structure of the stylus 20 shown in the foregoing embodiments is only an example. In other embodiments, the electronic device may include more or fewer modules, or some modules may be combined or split, which is not limited here.
[0413] This application also provides a computer program product, which may be a software or program product including instructions, capable of running on a computing device or stored on any usable medium. When the computer program product is run on at least one computing device, the at least one computing device implements the ink generation method provided in this application.
[0414] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any storage medium (e.g., magnetic medium, optical medium, semiconductor medium, etc.) capable of storing and / or retrieving data by a computing device. The computer-readable storage medium includes instructions that direct a computing device to implement the ink generation method provided in this application.
[0415] In the accompanying drawings, some structural or methodological features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be necessary. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. Furthermore, the inclusion of structural or methodological features in a particular figure does not imply that such features are required in all embodiments, and in some embodiments, these features may be omitted or may be combined with other features.
[0416] It should be noted that in the examples and description of this patent, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the term "comprising" or any other variations thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0417] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating ink marks, applied to electronic devices, characterized in that, include: The user selects the first brush, wherein the stamp of the first brush includes a first colored stamp; In response to a user's drawing operation, an ink mark corresponding to the drawing operation is generated and displayed, wherein the ink mark includes at least one second color stamp repeatedly drawn along the drawing trajectory corresponding to the drawing operation, and the second color stamp is obtained by blending a first color with the color of each pixel in the first color stamp; Wherein, the first color is a color selected by the user, or a color determined by the electronic device based on the color selected by the user, or a color randomly determined by the electronic device, or a color determined by the electronic device based on the stylus parameters of the stylus used to draw the drawing trajectory, wherein the stylus parameters include one or more of stylus pressure, stylus angle, and stylus tilt angle.
2. The method according to claim 1, characterized in that, The ink mark also includes at least one third color stamp repeatedly drawn along the drawing trajectory, the third color stamp being obtained by blending the second color with the colors of each pixel in the first color stamp.
3. The method according to claim 2, characterized in that, The ink mark includes a plurality of second color stamps, at least some of the second color stamps having different stamp parameters; And / or, the ink mark includes a plurality of the third color stamps, at least some of the third color stamps having different stamp parameters; The stamp parameters include at least one of the following: stamp size, stamp orientation, stamp opacity, stamp roundness, and stamp spacing.
4. The method according to claim 3, characterized in that, The at least some of the stamp parameters of the plurality of second color stamps are randomly determined by the electronic device, or determined by the electronic device based on the at least one stylus parameter; and / or, the at least some of the stamp parameters of the plurality of third color stamps are randomly determined by the electronic device, or determined by the electronic device based on the at least one stylus parameter.
5. The method according to claim 1, characterized in that, The first brush was generated in the following way: Upon detecting a user's operation of configuring the first brush based on a first color image, at least a portion of the image area in the first color image is configured as the first color stamp.
6. The method according to any one of claims 1 to 5, characterized in that, In the first color stamp, the color of the first pixel is the third color, and in the second color stamp, the color of the second pixel corresponding to the first pixel is the fourth color. The hue of the fourth color is the same as that of the first color, the saturation of the fourth color is obtained based on the saturation of the first color and / or the saturation of the third color, and the brightness of the fourth color is obtained based on the brightness of the first color and / or the brightness of the third color.
7. The method according to claim 6, characterized in that, The saturation of the fourth color is obtained based on the saturation of the first color and / or the saturation of the third color, including: The saturation of the fourth color is the same as the saturation of the first color; Alternatively, the saturation of the fourth color can be the product of the saturation of the first color and the first value. Alternatively, the saturation of the fourth color can be the sum of the saturation of the first color and the first saturation. Alternatively, the saturation of the fourth color may be the same as the saturation of the third color. Alternatively, the saturation of the fourth color can be the product of the saturation of the third color and the second value. Alternatively, the saturation of the fourth color is the sum of the saturation of the third color and the saturation of the second color; Alternatively, the saturation of the fourth color can be a weighted sum of the saturation of the first color and the saturation of the third color. Alternatively, the saturation of the fourth color can be the product of the saturation of the first color and the saturation of the third color.
8. The method according to claim 6 or 7, characterized in that, The lightness of the fourth color is obtained based on the lightness of the first color and / or the lightness of the third color, including: The brightness of the fourth color is the same as the brightness of the first color; Alternatively, the brightness of the fourth color is the product of the brightness of the first color and the third value; Alternatively, the brightness of the fourth color is the sum of the brightness of the first color and the brightness of the first color; The brightness of the fourth color is the same as the brightness of the third color; Alternatively, the brightness of the fourth color is the product of the brightness of the third color and the fourth value; Alternatively, the brightness of the fourth color is the sum of the brightness of the third color and the brightness of the second color; Alternatively, the brightness of the fourth color can be the weighted sum of the brightness of the first color and the brightness of the third color. Alternatively, the brightness of the fourth color can be the product of the brightness of the first color and the brightness of the third color. Alternatively, if the brightness of the first color is less than the brightness threshold, the brightness of the fourth color is twice the product of the brightness of the first color and the brightness of the third color; if the brightness of the first color is greater than or equal to the brightness threshold, the brightness of the fourth color is 1 - 2 × (1 - the brightness of the first color) × (1 - the brightness of the third color). Wherein, if the brightness of the fourth color is the same as the brightness of the first color, the saturation of the fourth color is not the same as the saturation of the first color; and if the brightness of the fourth color is the same as the brightness of the third color, the saturation of the fourth color is not the same as the saturation of the third color.
9. The method according to any one of claims 1 to 5, characterized in that, In the first color stamp, the color of the first pixel is the third color, and in the second color stamp, the color of the second pixel corresponding to the first pixel is the fourth color. Furthermore, the fourth color is obtained by scaling the pixel value of the intermediate color (obtained by fusing the first and third colors) in the RGB color model using a scaling factor. The intermediate color has the same hue as the first color, its saturation is based on the saturation of the first color and / or the saturation of the third color, its brightness is based on the brightness of the first color and / or the brightness of the third color, and the scaling factor is based on the brightness of the first color in the HSV color model.
10. The method according to claim 9, characterized in that, The scaling factor is the sum of the product of the first value and the brightness of the first color in the HSV color model and the second value, wherein the sum of the first value and the second value is 1, and the first value and the second value are greater than or equal to 0.
11. The method according to any one of claims 1 to 10, characterized in that, The first brush stamp also includes a fourth color stamp; the ink mark also includes at least one fifth color stamp repeatedly drawn along the drawing trajectory, the fifth color stamp being obtained by blending the fifth color with the colors of each pixel in the fourth color stamp.
12. The method according to claim 11, characterized in that, The ink mark also includes at least one sixth color stamp that is repeatedly drawn along the drawing trajectory, the sixth color stamp being obtained by fusing the sixth color with the colors of each pixel in the fourth color stamp.
13. The method according to claim 11 or 12, characterized in that, The overlapping area of the second and fifth color stamps in the ink is obtained based on a first color mixing mode, wherein the first color mixing mode is a color mixing mode selected by the user from at least one color mixing mode, or a color mixing mode determined by the electronic device from the at least one color mixing mode.
14. The method according to claim 13, characterized in that, The at least one color mixing mode includes one or more of the following color mixing modes: normal color mixing mode, multiply color mixing mode, darken color mixing mode, color burn color mixing mode, linear burn color mixing mode, color dodge color mixing mode, difference color mixing mode, subtract color mixing mode, cover color mixing mode, dissolve color mixing mode, dark color mixing mode, lighten color mixing mode, screen color mixing mode, linear dodge color mixing mode, light color mixing mode, soft light color mixing mode, hard light color mixing mode, bright light color mixing mode, linear light color mixing mode, point light color mixing mode, solid color mixing mode, exclusion color mixing mode, divide color mixing mode, hue color mixing mode, saturation color mixing mode, color mixing mode, and brightness color mixing mode.
15. The method according to claim 1, characterized in that, The first color stamp is a color stamp obtained by fusing the seventh color stamp with the first texture.
16. A readable storage medium, characterized in that, The readable storage medium includes one or more programs that, when executed on an electronic device, cause the electronic device to implement the ink generation method according to any one of claims 1 to 15.
17. An electronic device, characterized in that, include: Memory, used to store one or more programs; A processor for executing the one or more programs to cause the electronic device to implement the ink generation method according to any one of claims 1 to 15.
18. A program product, characterized in that, When the program product is executed on an electronic device, it causes the electronic device to implement the ink generation method according to any one of claims 1 to 15.