A full-color electronic paper color adjustment optimization method and device based on a dithering algorithm, a terminal device, and a storage medium

By using a dithering algorithm to calculate the color adjustment method for full-color electronic paper, the problems of data overflow and error in color adjustment are solved, achieving efficient color adjustment and ensuring the integrity of color information.

CN120236542BActive Publication Date: 2026-03-20JIANGXI XINGTAI TECH INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510246504.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-04
Publication Date
2026-03-20
Estimated Expiration
2045-03-04

AI Technical Summary

Technical Problem

In existing technologies, directly adjusting the color of an image can easily lead to data overflow and color errors, resulting in information loss.

Method used

A color adjustment method for full-color electronic paper based on dithering algorithm is adopted. By obtaining the pixel points of the image to be adjusted and the original three primary color values ​​of the full-color electronic paper, the theoretical three primary color values ​​and Euclidean distance at the color boundary are calculated to construct a set of colors to be selected. The color with the smallest Euclidean distance is selected as the target color for color adjustment.

Benefits of technology

This reduces data overflow and errors during color adjustment, ensuring that the adjusted image uses the original three primary color values ​​of full-color electronic paper, thus avoiding information loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120236542B_ABST
    Figure CN120236542B_ABST
Patent Text Reader

Abstract

The application discloses a full-color electronic paper color adjustment optimization method and device based on a dithering algorithm, terminal equipment and a storage medium. The method comprises the following steps: obtaining all pixel points of a color picture to be adjusted and original three primary color values of each color of the full-color electronic paper; determining a first color and a second color based on color adjustment requirements of the picture to be adjusted, and then determining adjustment coefficients of each second color; calculating theoretical three primary color values at a boundary between the first color and each second color; calculating theoretical three primary color values of the first color relative to each second color according to the theoretical three primary color values at the boundary between the first color and each second color; constructing a color set to be selected, determining a target color and original three primary color values of each target color, and outputting a color-adjusted picture according to the original three primary color values of the target color. Through implementation of the application, color adjustment can be performed on the color picture to be adjusted.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of image processing and display technology, and particularly relates to a full-color electronic paper color adjustment optimization method and device based on a dithering algorithm, a terminal device and a storage medium. BACKGROUND

[0002] The method for adjusting the color of a picture in the prior art is to directly adjust the color of the input picture. However, if the calculation exceeds 255, the part exceeding 255 will be cut off due to the limitation of the picture, and thus information is lost. For example, the picture needs to be adjusted to be reddish. (128-0-0) can be adjusted to (200-0-0), and the picture is reddish. However, if the picture is (200-0-0), it will be adjusted to (312-0-0), which exceeds the color limit of the picture, and thus the adjusted picture (255-0-0) has information loss. Therefore, directly adjusting the color of the picture may cause data overflow and color error in the color adjustment of the picture. SUMMARY

[0003] The present application provides a full-color electronic paper color adjustment optimization method and device based on a dithering algorithm, a terminal device and a storage medium. The present application can adjust the color of a picture to be adjusted based on a dithering algorithm through a full-color electronic paper.

[0004] An embodiment of the present application provides a full-color electronic paper color adjustment optimization method based on a dithering algorithm, comprising:

[0005] obtaining all pixel points of a picture to be adjusted and original tricolor values of each color of a full-color electronic paper;

[0006] determining a color that needs to increase the proportion and a color that needs to reduce the proportion in the picture to be adjusted based on the color adjustment requirement of the picture to be adjusted; taking the color that needs to increase the proportion as a first color, taking the color that needs to reduce the proportion as a second color, and then determining an adjustment coefficient of each second color;

[0007] calculating the theoretical tricolor value at the boundary of the first color and each second color according to the original tricolor value of the first color, the original tricolor value of each second color and the corresponding adjustment coefficient;

[0008] calculating the theoretical tricolor value of the first color relative to each second color according to the theoretical tricolor value at the boundary of the first color and each second color and the original tricolor value of the corresponding second color;

[0009] constructing a set of candidate colors according to all the theoretical tricolor values of the first color and the original tricolor values of each color of the full-color electronic paper.

[0010] For each pixel in the image to be adjusted, the Euclidean distance between the current pixel and each color in the set of colors to be selected is calculated based on the three primary color values ​​of the current pixel using the dithering algorithm, and the color with the smallest Euclidean distance is selected as the target color.

[0011] Determine the original three primary color values ​​for each target color to obtain the corresponding three primary color values ​​for each pixel in the image to be adjusted after color adjustment; output the color-adjusted image using full-color electronic paper based on the corresponding three primary color values ​​for each pixel in the image to be adjusted.

[0012] Furthermore, the theoretical primary color values ​​at the boundary between the first and second colors are calculated using the following formula:

[0013] RGB new =(R new G new B new );

[0014] in:

[0015]

[0016] In the formula, RGB new R is the theoretical primary color value at the boundary between the first and second colors. new G represents the red component value in the theoretical tri-color values ​​at the boundary between the first and second colors. new B is the green component value in the theoretical tri-color values ​​at the boundary between the first and second colors. new R is the blue component value in the theoretical tri-color values ​​at the boundary between the first and second colors. A R is the red component value in the original three primary color values ​​of the first color. B G is the red component value in the original three primary color values ​​of a second color, k is the adjustment factor, and G is the red component value. A G represents the green component value in the original three primary color values ​​of the first color. B B is the green component value in the original three primary color values ​​of a second color. A B is the blue component value in the original three primary color values ​​of the first color. B It is the blue component value in the original three primary color values ​​of a second color.

[0017] Furthermore, the theoretical primary color values ​​of the first color relative to the second color are calculated using the following formula:

[0018] RGB A = (2×R) new -R B ,2×Gnew -G B , 2 x B new -B B );

[0019] In the formula, RGB A is the theoretical tricolor value of the first color relative to a second color.

[0020] Further, the Euclidean distance is calculated by the following formula:

[0021] distance = ((R1-R2) 2 +(G1-G2) 2 +(B1-B2) 2 ) 1 / 2 ;

[0022] In the formula, distance is the Euclidean distance of the current pixel point and a selected color in the color set to be selected, R1 is the red component value in the current tricolor value of the current pixel point, R2 is the red component value of a selected color in the color set to be selected, G1 is the green component value in the current tricolor value of the current pixel point, G2 is the green component value of a selected color in the color set to be selected, B1 is the blue component value in the current tricolor value of the current pixel point, and B2 is the blue component value of a selected color in the color set to be selected.

[0023] Another embodiment of the present application provides a full-color electronic paper color adjustment optimization device based on a dithering algorithm, comprising: a data acquisition module, an adjustment coefficient determination module, a boundary processing value determination module, a first color theoretical value calculation module, a set construction module, a target color determination module, and a picture output module.

[0024] The data acquisition module is configured to acquire all pixel points of a color picture to be adjusted and original tricolor values of each color of the full-color electronic paper.

[0025] The adjustment coefficient determination module is configured to determine colors that need to increase in proportion and colors that need to decrease in proportion in the color picture to be adjusted based on color adjustment requirements of the color picture to be adjusted, take the colors that need to increase in proportion as first colors, take the colors that need to decrease in proportion as second colors, and then determine adjustment coefficients of the second colors.

[0026] The boundary processing value determination module is configured to calculate theoretical tricolor values at boundaries of the first colors and the second colors according to the original tricolor values of the first colors, the original tricolor values of the second colors, and the corresponding adjustment coefficients.

[0027] The first color theoretical value calculation module is configured to calculate the theoretical tricolor value of the first color relative to each second color according to the theoretical tricolor value at the boundary between the first color and each second color and the original tricolor value of the corresponding second color.

[0028] The set construction module is configured to construct the candidate color set according to all the theoretical tricolor values of the first color and the original tricolor values of the original colors of the full-color electronic paper.

[0029] The target color determination module is configured to, for each pixel point in the picture to be adjusted, calculate the Euclidean distance between the current pixel point and each color in the candidate color set according to the tricolor value of the current pixel point based on a dithering algorithm, and select the color with the smallest Euclidean distance as the target color.

[0030] The picture output module is configured to determine the original tricolor value of each target color, to obtain the corresponding tricolor value required after color adjustment of each pixel point in the picture to be adjusted, and to output the picture after color adjustment by the full-color electronic paper according to the corresponding tricolor value required after color adjustment of each pixel point in the picture to be adjusted.

[0031] Further, the theoretical tricolor value at the boundary between the first color and a second color is calculated by the following formula:

[0032] RGB new =(R new ,G new ,B new );

[0033] Wherein:

[0034]

[0035]

[0036] In the formula, RGB new is the theoretical tricolor value at the boundary between the first color and a second color, R new is the red component value in the theoretical tricolor value at the boundary between the first color and a second color, G new is the green component value in the theoretical tricolor value at the boundary between the first color and a second color, B new is the blue component value in the theoretical tricolor value at the boundary between the first color and a second color, R A is the red component value in the original tricolor value of the first color, R B is the red component value in the original tricolor value of a second color, k is an adjustment coefficient, G A is the green component value in the original tricolor value of the first color, G BB is a blue component value in the original tri-stimulus value of a second color. A B is a blue component value in the original tri-stimulus value of a first color. B B is a blue component value in the original tri-stimulus value of a second color.

[0037] Further, the theoretical tri-stimulus value of a first color relative to a second color is calculated by the following formula:

[0038] RGB A = (2×R new -R B , 2×G new -G B , 2×B new -B B ) ;

[0039] In the formula, RGB A is the theoretical tri-stimulus value of a first color relative to a second color.

[0040] Further, the Euclidean distance is calculated by the following formula:

[0041] distance = ((R1-R2) 2 +(G1-G2) 2 +(B1-B2) 2 ) 1 / 2 ;

[0042] In the formula, distance is the Euclidean distance between a current pixel point and a selected color in a set of selected colors, R1 is a red component value in the current tri-stimulus value of the current pixel point, R2 is a red component value of a selected color in the set of selected colors, G1 is a green component value in the current tri-stimulus value of the current pixel point, G2 is a green component value of a selected color in the set of selected colors, B1 is a blue component value in the current tri-stimulus value of the current pixel point, and B2 is a blue component value of a selected color in the set of selected colors.

[0043] Another embodiment of the present application provides a terminal device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements a full-color electronic paper color adjustment optimization method based on a dithering algorithm according to any one of the embodiments.

[0044] Another embodiment of the present application provides a storage medium, comprising a stored computer program, wherein the computer program controls a device in which the storage medium is located to execute a full-color electronic paper color adjustment optimization method based on a dithering algorithm according to any one of the embodiments when the computer program is running.

[0045] By implementing the present application, the following advantages are achieved:

[0046] The application discloses a full-color electronic paper color adjustment optimization method and device based on a dithering algorithm, a terminal equipment and a storage medium. The method obtains all pixel points of a color picture to be adjusted and original three primary color values of each color of the full-color electronic paper. Based on color adjustment requirements of the color picture to be adjusted, a first color and a second color are determined, and then adjustment coefficients of each second color are determined. Theoretical three primary color values at a boundary between the first color and each second color are calculated. The theoretical three primary color values at the boundary between the first color and each second color are calculated, and the theoretical three primary color values of the first color relative to each second color are calculated. A color set to be selected is constructed, and original three primary color values of a target color and each target color are determined. A color-adjusted picture is output based on the original three primary color values of the target color. In the application, all theoretical three primary color values of the first color are calculated based on color adjustment requirements, a color set to be selected is constructed, a target color of the color picture to be adjusted is determined based on the color set to be selected by using the dithering algorithm, and finally, a color-adjusted picture is output based on original three primary color values corresponding to the target color. The original three primary color values of the full-color electronic paper are used for outputting the picture, and therefore, the color adjustment of the application does not cause data overflow, and reduces errors in the color adjustment process. BRIEF DESCRIPTION OF DRAWINGS

[0047] Figure 1 FIG. 1 is a flowchart of a full-color electronic paper color adjustment optimization method based on a dithering algorithm according to an embodiment of the application.

[0048] Figure 2 FIG. 2 is a comparison diagram of a dithering algorithm and a numerical method for adjusting picture color according to an embodiment of the application.

[0049] Figure 3 FIG. 3 is a structural diagram of a full-color electronic paper color adjustment optimization method based on a dithering algorithm according to an embodiment of the application. DETAILED DESCRIPTION

[0050] To make the objectives, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0051] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of this application; the use of the terms "including," "comprising," "having" and "with" in the specification and claims herein are used to mean "including but not limited to" or "comprising but not limited to" or "having but not limited to" or "with but not limited to," and are not used to mean "consisting only of" or "consisting only of."

[0052] In the description of the embodiments of the present application, the technical terms "first", "second" and the like are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "a plurality of" is two or more, unless otherwise explicitly and specifically limited.

[0053] As Figure 1 shown, it is a flowchart of a full-color electronic paper color adjustment optimization method based on a jitter algorithm according to an embodiment of the present application, comprising the following steps:

[0054] Step S1, obtaining all pixel points of the color picture to be adjusted and the original three primary color values of each color of the full-color electronic paper;

[0055] In the present application, all pixel points in the color picture to be adjusted and the three primary color values corresponding to all pixel points are obtained, and the original three primary color values of each color of the full-color electronic paper are obtained, which provides a data basis for subsequent calculation in color adjustment. The original three primary color values of each color of the full-color electronic paper are inherent properties in the physical layer. These original three primary color values are actual existing and fixed values, which will not change due to changes in external conditions or the use state of the electronic paper.

[0056] Illustratively, a color picture to be adjusted with an entire screen of orange, the three primary color values of all pixel points of the picture are P(x, y) = RGB(255-128-0), and the original three primary color values of each color of the full-color electronic paper are Ablack = (0, 0, 0), Awhite = (255, 255, 255), Ared = (255, 0, 0), Agreen = (0, 255, 0), Ablue = (0, 0, 255), Acyan = (0, 255, 255), Ayellow = (255, 0, 255), and Ayellow = (255, 255, 0).

[0057] Step S2, based on the color adjustment requirement of the picture to be adjusted, determining the color that needs to increase the proportion and the color that needs to reduce the proportion in the color picture to be adjusted; taking the color that needs to increase the proportion as the first color, taking the color that needs to reduce the proportion as the second color, and then determining the adjustment coefficient of each second color;

[0058] Specifically, suppose an image to be adjusted has 85% red and 15% yellow in a normal shake display on a full-color e-paper screen. The color adjustment requirement is to increase the proportion of red by 10% and decrease the proportion of yellow by 10%. In this case, the first color is red and the second color is yellow.

[0059] If an image to be adjusted has 70% red, 20% yellow, and 10% green in a normal, dithered display on a full-color e-paper screen, the color adjustment requirement is to increase the proportion of red by 10%, decrease the proportion of yellow by 5%, and decrease the proportion of green by 5%. In this case, the first color is red, and the second colors are yellow and green.

[0060] The adjustment factor is calculated as follows: K = (reduction in the proportion of the second color) ÷ (proportion of the corresponding second color in the image);

[0061] Using the above example again: Suppose that red accounts for 85% of an image to be adjusted and yellow accounts for 15%. The color adjustment requirement is to increase the proportion of red by 10% and decrease the proportion of yellow by 10%. In this case, the first color is red, and the second color is yellow. The adjustment coefficient for the second color is: K1 = 10% ÷ 15% = 0.667.

[0062] If a picture to be adjusted contains 70% red, 20% yellow, and 10% green, the desired color adjustment is to increase the proportion of red by 10%, decrease the proportion of yellow by 5%, and decrease the proportion of green by 5%. In this case, the primary color is red, and the secondary colors are yellow and green.

[0063] When the second color is yellow, the adjustment factor for the second color is: K2 = 5% ÷ 20% = 0.25;

[0064] When the second color is green, the adjustment factor for the second color is: K3 = 5% ÷ 10% = 0.5;

[0065] Step S3: Calculate the theoretical primary color values ​​at the boundary between the first color and each of the second colors based on the original primary color values ​​of the first color, the original primary color values ​​of each of the second colors, and the corresponding adjustment coefficients.

[0066] In a preferred embodiment, the theoretical primary color values ​​at the boundary between the first color and a second color are calculated using the following formula:

[0067] RGBnew = (R new , G new , B new ) ;

[0068] wherein:

[0069]

[0070] wherein RGB new is a theoretical tristimulus value at a boundary between a first color and a second color, R new is a red component value in the theoretical tristimulus value at the boundary between the first color and the second color, G new is a green component value in the theoretical tristimulus value at the boundary between the first color and the second color, B new is a blue component value in the theoretical tristimulus value at the boundary between the first color and the second color, R A is a red component value in an original tristimulus value of the first color, R B is a red component value in an original tristimulus value of a second color, k is an adjustment coefficient, G A is a green component value in the original tristimulus value of the first color, G B is a green component value in the original tristimulus value of the second color, B A is a blue component value in the original tristimulus value of the first color, B B is a blue component value in the original tristimulus value of the second color;

[0071] Specifically, assuming that a picture to be adjusted has a red color occupying 85% in the picture and a yellow color occupying 15% in the picture in a normal dithering display of the full-color electronic paper, a color adjustment requirement is to increase the red color in the picture by 10% and to decrease the yellow color in the picture by 10%, and original tristimulus values of the colors of the full-color electronic paper are Ablack=(0, 0, 0), Awhite=(255, 255, 255), Ared=(255, 0, 0), Agreen=(0, 255, 0), Ablue=(0, 0, 255), Acyan=(0, 255, 255), Ayellow=(255, 0, 255), and Aorange=(255, 255, 0).

[0072] Then the first color is red and the original tristimulus value thereof is (255, 0, 0), the second color is yellow and the original tristimulus value thereof is (255, 255, 0), and the adjustment coefficient k1 is 0.667, and calculation is performed according to the above formula. RGB new=(255, 213.11, 0); so the theoretical tricolor value at the boundary between the first color (red) and the second color (yellow) is (255, 213.11, 0) at this time, wherein the theoretical tricolor value at the boundary is a theoretical reference value calculated by a mathematical formula, used to represent the boundary position between the first color and each second color, which does not represent an actually existing color value, but is used to guide the calculation of the subsequent steps. This theoretical value is an intermediate calculation result, which helps us logically clarify the division of the color range, but will not be directly applied to actual display or output.

[0073] If a picture to be adjusted is in the normal jitter display of the full-color electronic paper, the red color accounts for 70% in the picture, the yellow color accounts for 20% in the picture, and the green color accounts for 10% in the picture. At this time, the color adjustment requirement is to increase the red color by 10% in the picture, to reduce the yellow color by 5% in the picture, and to reduce the green color by 5% in the picture. At this time, the original tricolor values of each color of the full-color electronic paper are: Ablack=(0, 0, 0), Awhite=(255, 255, 255), Ared=(255, 0, 0), Agreen=(0, 255, 0), Ablue=(0, 0, 255), Acyan=(0, 255, 255), Ayellow=(255, 0, 255), and Awhite=(255, 255, 0).

[0074] At this time, the first color is red, and its original tricolor value is (255, 0, 0).

[0075] When the second color is yellow, its original tricolor value is (255, 255, 0), and the adjustment coefficient K2 between the first color (red) and the second color (yellow) is 0.25. According to the above formula, the calculation is as follows:

[0076] 159.38; RGB new =(255, 159.38, 0); so the theoretical tricolor value at the boundary between the first color (red) and the second color (yellow) is (255, 159.38, 0) at this time.

[0077] When the second color is green, its original tricolor value is (0, 255, 0), and the adjustment coefficient K3 between the first color (red) and the second color (green) is 0.5. According to the above formula, the calculation is as follows:

[0078] RGB new =(63.75, 191.25, 0); so the theoretical tricolor value at the boundary between the first color (red) and the second color (green) is (63.75, 191.25, 0) at this time.

[0079] Step S4: Calculate the theoretical primary color value of the first color relative to each second color based on the theoretical primary color value at the boundary between the first color and each second color, and the original primary color value of the corresponding second color.

[0080] In a preferred embodiment, the theoretical primary color values ​​of the first color relative to a second color are calculated using the following formula:

[0081] RGB A = (2×R) new -R B ,2×G new -G B ,2×B new -B B );

[0082] In the formula, RGB A The theoretical primary color values ​​of the first color relative to the second color.

[0083] Specifically, assuming an image to be adjusted has 85% red and 15% yellow in a normal dithered display on a full-color e-paper screen, the color adjustment requirement is to increase the proportion of red by 10% and decrease the proportion of yellow by 10%. Then, the theoretical primary color values ​​at the boundary between the first color (red) and the second color (yellow) are (255, 213.11, 0). The second color is yellow, and its original primary color values ​​are (255, 255, 0). The RGB values ​​are calculated using the formula above. A = (2×255-255, 2×213.11-255, 2×0-0) = (255, 171.22, 0), so the theoretical primary color value of the first color (red) relative to the second color (yellow) is (255, 171.22, 0). Here, the theoretical primary color value of the first color relative to each of the second colors is a theoretical reference value calculated by mathematical formula. It is used to guide the logical calculation of color classification and adjustment, but does not represent the actual displayed or output color value. Its role is to serve as an intermediate result in the calculation process to help determine the division of color range, and it will not be directly applied to the actual display device or the final output image.

[0084] If a picture to be adjusted is in the normal jitter display of the full-color electronic paper, the red color accounts for 70% in the picture, the yellow color accounts for 20% in the picture, and the green color accounts for 10% in the picture, at this time, the color adjustment requirement is to increase the red color proportion in the picture by 10%, to reduce the yellow color proportion in the picture by 5%, and to reduce the green color proportion in the picture by 5%; then, when the second color is yellow, the original three primary color values are (255, 255, 0), the theoretical three primary color values at the boundary of the first color (red) and the second color (yellow) are (255, 159.38, 0), and the RGB is calculated according to the above formula A =(2*255-255, 2*159.38-255, 2*0-0) = (255, 63.76, 0), so the theoretical three primary color values of the first color (red) relative to the second color (yellow) are (255, 63.76, 0) at this time.

[0085] When the second color is green, the original three primary color values are (0, 255, 0), the theoretical three primary color values at the boundary of the first color (red) and the second color (green) are (63.75, 191.25, 0), and the RGB is calculated according to the above formula A =(2*63.75-0, 2*191.25-255, 2*0-0) = (127.5, 127.5, 0), so the theoretical three primary color values of the first color (red) relative to the second color (green) are (127.5, 127.5, 0) at this time.

[0086] Step S5, constructing a to-be-selected color set according to all the theoretical three primary color values of the first color and the original three primary color values of each color of the full-color electronic paper.

[0087] In the present application, all the calculated theoretical three primary color values of the first color are added to the original three primary color values of each color of the full-color electronic paper to construct a to-be-selected color set, so as to prepare data for subsequent jitter algorithm calculation.

[0088] To illustrate, if an image to be adjusted has 85% red and 15% yellow in a normal dithered display on a full-color e-paper screen, and the color adjustment requirement is to increase the proportion of red by 10% and decrease the proportion of yellow by 10%, then the theoretical primary color values ​​of the first color (red) relative to the second color (yellow) are (255, 171.22, 0). Therefore, the set of colors to be selected includes: first color (red) = (255, 171.22, 0), A black = (0, 0, 0), A white = (255, 255, 255), A red = (255, 0, 0), A green = (0, 255, 0), A blue = (0, 0, 255), A cyan = (0, 255, 255), A magenta = (255, 0, 255), A yellow = (255, 255, 0).

[0089] If an image to be adjusted has 70% red, 20% yellow, and 10% green in a normal dithered display on full-color e-paper, and the desired color adjustment is to increase the proportion of red by 10%, decrease the proportion of yellow by 5%, and decrease the proportion of green by 5%, then the theoretical primary color value of the first color (red) relative to one of the second colors (yellow) is (255, 63.76, 0), and the theoretical primary color value relative to the other second color (green) is (127). If the values ​​are 5, 127.5, 0, then the set of colors to be selected includes: First color (red) = (255, 63.76, 0), First color (green) = (127.5, 127.5, 0), A black = (0, 0, 0), A white = (255, 255, 255), A red = (255, 0, 0), A green = (0, 255, 0), A blue = (0, 0, 255), A cyan = (0, 255, 255), A magenta = (255, 0, 255), A yellow = (255, 255, 0).

[0090] Step S6: For each pixel in the image to be adjusted, calculate the Euclidean distance between the current pixel and each color in the set of colors to be selected based on the three primary color values ​​of the current pixel using the dithering algorithm, and select the color with the smallest Euclidean distance as the target color.

[0091] In this invention, for each pixel in the image to be adjusted, based on the dithering algorithm, the Euclidean distance between the current pixel and each color in the set of colors to be selected is calculated according to the three primary color values ​​of the current pixel. The smaller the Euclidean distance, the closer the colors are. The color with the smallest Euclidean distance to the current pixel is selected from the set of colors to be selected as the target color, and the target color of all pixels is obtained.

[0092] Specifically, the steps include the following:

[0093] Step one, selecting a current pixel point with an undetermined target color from a picture to be adjusted;

[0094] Step two, calculating the Euclidean distance between the current pixel point and each color in the color set to be selected according to the current three primary color values of the current pixel point and the color set to be selected, and selecting the color with the minimum Euclidean distance as the target color;

[0095] Step three, when it is determined that there is a pixel point with an undetermined target color in the picture to be adjusted, calculating the color error according to the three primary color values of the target color in the color set to be selected and the current three primary color values of the current pixel point;

[0096] Step four, distributing the color error to the pixel points directly adjacent to the current pixel point according to a preset ratio, adjusting the three primary color values of the directly adjacent pixel points, selecting one of the directly adjacent pixel points as a new current pixel point, and jumping to execute Step two;

[0097] Repeating the above process until the target colors of all pixel points in the picture are determined.

[0098] In a preferred embodiment, the Euclidean distance is calculated by the following formula:

[0099] distance = ((R1-R2) 2 +(G1-G2) 2 +(B1-B2) 2 ) 1 / 2 ;

[0100] In the formula, distance is the Euclidean distance between the current pixel point and a selected color in the color set to be selected, R1 is the red component value in the current three primary color values of the current pixel point, R2 is the red component value of a selected color in the color set to be selected, G1 is the green component value in the current three primary color values of the current pixel point, G2 is the green component value of a selected color in the color set to be selected, B1 is the blue component value in the current three primary color values of the current pixel point, and B2 is the blue component value of a selected color in the color set to be selected.

[0101] For illustration, an embodiment is described as follows:

[0102] Suppose a picture to be adjusted has four pixel points, each being P = (255-128-0), and the color set to be selected includes: a first color (red) = (255, 100, 0), A black = (0, 0, 0), A white = (255, 255, 255), A red = (255, 0, 0), A green = (0, 255, 0), A blue = (0, 0, 255), A cyan = (0, 255, 255), A magenta = (255, 0, 255), and A yellow = (255, 255, 0).

[0103] Select one of the pixel points P to determine the color, calculate the Euclidean distance of each color in the color set to be selected and the pixel point, and calculate the Euclidean distance by the above formula to obtain the first color (red) with the minimum Euclidean distance. The first color (red) is selected as the target color;

[0104] Calculate the color error after determining the target color, DeltaE = P (255-128-0)-first color (red) (255-100-0) = (0, 28, 0), wherein DeltaE represents the color error, and the error is distributed to the adjacent points according to the preset proportion, for example: assuming that the right side is given, the right side pixel point is also P = (255-128-0), and P+DeltaE = (255-156-0) is obtained by adding them. The three primary color values of the adjusted right side P are (255-156-0);

[0105] Select the adjusted right side P to continue color determination, and repeat the above steps until all pixel points are determined to have target colors. Through calculation, the target colors of the four pixel points are: the first color (red) + the first color (red) + A yellow + the first color (red).

[0106] Step S7, determine the original three primary color values of each target color to obtain the corresponding three primary color values required after color adjustment of each pixel point in the picture to be adjusted; and output the picture after color adjustment through the full-color electronic paper according to the corresponding three primary color values required after color adjustment of each pixel point in the picture to be adjusted.

[0107] Specifically, assuming that the target colors of the four pixel points are: the first color (red) + the first color (red) + A yellow + the first color (red), wherein the original three primary color values of the first color (red) are the original three primary color values of A red in the full-color electronic paper, and A red (255, 0, 0) is used as the value of the first color (red). The original three primary color values of A yellow are (255, 255, 0), and the original three primary color values of each target color are used to replace the values of all pixel points in the picture to be adjusted to obtain the picture after color adjustment. In the absence of the first color, the color expression of the picture after dithering calculation is red + yellow + red + yellow, and after adding the first color, the calculation picture expression is red + red + yellow + red, and the expression of red is increased, so the picture becomes red.

[0108] Preferably, all pixel points of the picture after color adjustment output by the present application are expressed by the original three primary color values of the full-color electronic paper, and there is no data overflow of the three primary color values, thereby reducing the color error in the picture color adjustment process. Figure 2As shown, a is a normal dithering point diagram, b is a color adjustment diagram based on a dithering algorithm, and c is a numerical color adjustment diagram. Compared with numerical color adjustment, the dithering algorithm has less data loss and can see more details of the picture.

[0109] As shown in the formula (1), the color adjustment method based on the dithering algorithm is used to adjust the color of the picture. Figure 3 As shown, it is a structural schematic diagram of a full-color electronic paper color adjustment optimization device based on a dithering algorithm according to an embodiment of the present application, comprising:

[0110] The data acquisition module, the adjustment coefficient determination module, the boundary processing theoretical value determination module, the first color theoretical value calculation module, the set construction module, the target color determination module, and the picture output module are provided.

[0111] The data acquisition module is configured to acquire all pixel points of the color picture to be adjusted and original three primary color values of each color of the full-color electronic paper.

[0112] The adjustment coefficient determination module is configured to determine colors that need to increase the proportion and colors that need to reduce the proportion in the color picture to be adjusted based on the color adjustment requirement of the picture to be adjusted, take the colors that need to increase the proportion as the first color, take the colors that need to reduce the proportion as the second color, and then determine the adjustment coefficient of each second color.

[0113] The boundary processing theoretical value determination module is configured to calculate the theoretical three primary color values at the boundary of the first color and each second color according to the original three primary color values of the first color, the original three primary color values of each second color, and the corresponding adjustment coefficient.

[0114] The first color theoretical value calculation module is configured to calculate the theoretical three primary color values of the first color relative to each second color according to the theoretical three primary color values at the boundary of the first color and each second color and the original three primary color values of the corresponding second color.

[0115] The set construction module is configured to construct a candidate color set according to all theoretical three primary color values of the first color and original three primary color values of each original color of the full-color electronic paper.

[0116] The target color determination module is configured to calculate the Euclidean distance between the current pixel point and each color in the candidate color set according to the three primary color values of the current pixel point based on the dithering algorithm for each pixel point in the picture to be adjusted, and select the color with the smallest Euclidean distance as the target color.

[0117] The picture output module is configured to determine the original three primary color values of each target color, obtain the corresponding three primary color values required after color adjustment of each pixel point in the picture to be adjusted, and output the picture after color adjustment according to the corresponding three primary color values required after color adjustment of each pixel point in the picture to be adjusted by the full-color electronic paper.

[0118] It can be understood that the above-mentioned device embodiment is corresponding to the method embodiment of the present application, which can realize the full-color electronic paper color adjustment optimization method based on the dithering algorithm provided by any one of the above-mentioned method embodiments.

[0119] It should be noted that the above-described device embodiments are only schematic, and the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., they can be located in one place, or distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the present embodiment scheme. In addition, the connection relationship between the modules in the device embodiment provided by the present application indicates that there is a communication connection between them, which can be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement it without creative labor.

[0120] Those skilled in the art can clearly understand that, in order to facilitate and be brief, the specific working process of the above-described device can refer to the corresponding process in the foregoing method embodiments, which will not be described here.

[0121] Another preferred embodiment of the present application provides a terminal device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the full-color electronic paper color adjustment optimization method based on the dithering algorithm when executing the computer program.

[0122] It should be noted that the terminal device mentioned here can be a desktop computer, a notebook computer, a palm computer, a cloud server, and other computing devices. The terminal device can include, but is not limited to, a processor, a memory. Those skilled in the art can understand that it can also include input / output devices, network access devices, buses, etc.

[0123] The processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The processor is a control center of the terminal device, and connects all parts of the terminal device through various interfaces and lines.

[0124] The memory can be used to store the computer program, and the processor realizes various functions of the terminal device by running or executing the computer program stored in the memory and calling data stored in the memory. The memory can mainly include a program storage area and a data storage area. The program storage area can store an operating system, at least one application required by a function, etc.; and the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory, and can also include a nonvolatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state memory devices.

[0125] Another preferred embodiment of the present application provides a storage medium including a stored computer program, wherein the computer program controls a device in which the storage medium is located to perform the full-color electronic paper color adjustment optimization method based on the dithering algorithm according to any one of the embodiments of the present application when the computer program is running.

[0126] The storage medium is a computer readable storage medium, and the computer program is stored in the computer readable storage medium. The computer program, when executed by a processor, can implement the steps of each method embodiment described above. The computer program includes computer program code, which can be in the form of source code, object code, an executable file, or some intermediate form, etc. The computer readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0127] The above is the preferred embodiment of the present application. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which are also considered within the scope of protection of the present application.

Claims

1. A method for color adjustment and optimization of full-color electronic paper based on a dithering algorithm, characterized in that, include: Obtain all pixels of the image to be adjusted and the original three primary color values ​​of each color in the full-color electronic paper; Based on the color adjustment requirements of the image to be adjusted, determine the colors that need to increase their proportion and the colors that need to decrease their proportion in the image; designate the colors that need to increase their proportion as the first color and the colors that need to decrease their proportion as the second color, and then determine the adjustment coefficients for each second color. Based on the original three primary color values ​​of the first color, the original three primary color values ​​of each second color, and the corresponding adjustment coefficients, calculate the theoretical three primary color values ​​at the boundary between the first color and each second color. Based on the theoretical primary color values ​​at the boundary between the first color and each second color, and the original primary color values ​​of the corresponding second color, the theoretical primary color values ​​of the first color relative to each second color are calculated. Based on all the theoretical primary color values ​​of the first color and the original primary color values ​​of each color in the full-color electronic paper, construct a set of colors to be selected; For each pixel in the image to be adjusted, the Euclidean distance between the current pixel and each color in the set of colors to be selected is calculated based on the three primary color values ​​of the current pixel using the dithering algorithm, and the color with the smallest Euclidean distance is selected as the target color. Determine the original three primary color values ​​for each target color to obtain the corresponding three primary color values ​​required for color adjustment of each pixel in the image to be adjusted; output the color-adjusted image using full-color electronic paper based on the corresponding three primary color values ​​required for color adjustment of each pixel in the image to be adjusted. The theoretical primary color values ​​at the boundary between the first color and the second color are calculated using the following formula: ; in: ; ; ; In the formula, These are the theoretical primary color values ​​at the boundary between the first and second colors. This represents the red component value in the theoretical tri-color values ​​at the boundary between the first and second colors. This represents the green component value in the theoretical tri-color values ​​at the boundary between the first and second colors. This represents the blue component value in the theoretical tri-color values ​​at the boundary between the first and second colors. The red component value is the original three primary color values ​​of the first color. The red component value is the original three primary color value of a second color, and k is an adjustment factor. The green component value is the original three primary color values ​​of the first color. This refers to the green component value in the original three primary color values ​​of a second color. This represents the blue component value in the original three primary color values ​​of the first color. The blue component value is the original three primary color value of a second color; The theoretical primary color values ​​of the first color relative to the second color are calculated using the following formula: ; In the formula, The theoretical primary color values ​​of the first color relative to the second color; The formula for calculating the adjustment factor is: k = (reduction in the proportion of the second color) ÷ (proportion of the corresponding second color in the image).

2. The method for color adjustment and optimization of full-color electronic paper based on dithering algorithm as described in claim 1, characterized in that, The Euclidean distance is calculated using the following formula: distance=((R1-R2) 2 +(G1-G2) 2 +(B1-B2) 2 ) 1 / 2 ; In the formula, distance is the Euclidean distance between the current pixel and a selected color in the set of colors to be selected, R1 is the red component value of the current pixel's three primary color values, R2 is the red component value of a selected color in the set of colors to be selected, G1 is the green component value of the current pixel's three primary color values, G2 is the green component value of a selected color in the set of colors to be selected, B1 is the blue component value of the current pixel's three primary color values, and B2 is the blue component value of a selected color in the set of colors to be selected.

3. A color adjustment and optimization device for full-color electronic paper based on a dithering algorithm, characterized in that, include: Data acquisition module, adjustment coefficient determination module, boundary processing theoretical value determination module, first color theoretical value calculation module, set construction module, target color determination module, image output module; The data acquisition module is used to acquire all pixels of the color image to be adjusted and the original three primary color values ​​of each color of the full-color electronic paper; The adjustment coefficient determination module is used to determine the colors that need to increase their proportion and the colors that need to decrease their proportion in the color image to be adjusted based on the color adjustment requirements of the image to be adjusted; the colors that need to increase their proportion are designated as the first colors, and the colors that need to decrease their proportion are designated as the second colors, and then the adjustment coefficients of each second color are determined. The boundary processing theoretical value determination module is used to calculate the theoretical primary color values ​​at the boundary between the first color and each of the second colors based on the original three primary color values ​​of the first color, the original three primary color values ​​of each of the second colors, and the corresponding adjustment coefficients. The first color theoretical value calculation module is used to calculate the theoretical primary color value of the first color relative to each second color based on the theoretical primary color value at the boundary between the first color and each second color, and the original primary color value of the corresponding second color. The set construction module is used to construct a set of colors to be selected based on all the theoretical primary color values ​​of the first color and the original primary color values ​​of each color of the full-color electronic paper. The target color determination module is used to calculate the Euclidean distance between each pixel in the image to be adjusted and each color in the set of colors to be selected based on the dithering algorithm and the three primary color values ​​of the current pixel, and select the color with the smallest Euclidean distance as the target color. The image output module is used to determine the original three primary color values ​​of each target color, obtain the three primary color values ​​required for color adjustment of each pixel in the image to be adjusted, and output the color-adjusted image through full-color electronic paper based on the three primary color values ​​required for color adjustment of each pixel in the image to be adjusted. The theoretical primary color values ​​at the boundary between the first color and the second color are calculated using the following formula: ; in: ; ; ; In the formula, These are the theoretical primary color values ​​at the boundary between the first and second colors. This represents the red component value in the theoretical tri-color values ​​at the boundary between the first and second colors. This represents the green component value in the theoretical tri-color values ​​at the boundary between the first and second colors. This represents the blue component value in the theoretical tri-color values ​​at the boundary between the first and second colors. The red component value is the original three primary color values ​​of the first color. The red component value is the original three primary color value of a second color, and k is an adjustment factor. The green component value is the original three primary color values ​​of the first color. This refers to the green component value in the original three primary color values ​​of a second color. This represents the blue component value in the original three primary color values ​​of the first color. The blue component value is the original three primary color value of a second color; The theoretical primary color values ​​of the first color relative to the second color are calculated using the following formula: ; In the formula, The theoretical primary color values ​​of the first color relative to the second color; The formula for calculating the adjustment factor is: k = (reduction in the proportion of the second color) ÷ (proportion of the corresponding second color in the image).

4. The color adjustment and optimization device for full-color electronic paper based on dithering algorithm as described in claim 3, characterized in that, The Euclidean distance is calculated using the following formula: distance=((R1-R2) 2 +(G1-G2) 2 +(B1-B2) 2 ) 1 / 2 ; In the formula, distance is the Euclidean distance between the current pixel and a selected color in the set of colors to be selected, R1 is the red component value of the current pixel's three primary color values, R2 is the red component value of a selected color in the set of colors to be selected, G1 is the green component value of the current pixel's three primary color values, G2 is the green component value of a selected color in the set of colors to be selected, B1 is the blue component value of the current pixel's three primary color values, and B2 is the blue component value of a selected color in the set of colors to be selected.

5. A terminal device, characterized in that, The device includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements a full-color electronic paper color adjustment optimization method based on a dithering algorithm as described in any one of claims 1 to 2.

6. A storage medium, characterized in that, The storage medium includes a stored computer program, wherein, when the computer program is running, it controls the device where the storage medium is located to execute a full-color electronic paper color adjustment optimization method based on dithering algorithm as described in any one of claims 1 to 2.

Citation Information

Patent Citations

  • Method for rendering color images

    CN110392911A

  • Picture color adjusting method and device, computer equipment and storage medium

    CN113286136A