A seven-color image display method based on error diffusion
By converting the target image of the seven-color electronic paper display in RGB format into HSV format and using the error diffusion algorithm to generate the background image, the problem of the single color of the seven-color electronic paper display is solved, achieving richer color performance and better viewing effects while reducing costs.
Patent Information
- Application Number
- CN202211609047.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-14
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-12-14
AI Technical Summary
The seven-color e-paper display has a single color variety and a high cost, resulting in insufficient color richness and poor visual experience.
Convert the target image in RGB format to HSV format, set the threshold t, and create six sub-images. Each sub-image consists of black and a different color in the target image. Use the error diffusion algorithm to adjust the pixel color and merge them to generate a background image to achieve a grayscale-like depth change.
The color richness and visual effects of the electronic paper display are improved, making the colors smoother, the viewing experience better, and the cost lower.
Smart Images

Figure CN115909941B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image display, and in particular to a seven-color picture display method based on error diffusion. Background Art
[0002] Compared with LCD or OLED displays, electronic paper displays often display fewer colors. One type of seven-color electronic paper display only displays seven colors: black, white, red, green, blue, yellow, and orange, making the color saturation very simple. However, the variety of colors of this seven-color electronic paper display will increase the cost.
[0003] Error diffusion is the process of spreading the error of resolution changes when color depth is reduced, so that when the naked eye observes the image, the overall error of the adjacent pixel set becomes smaller. From a visual perspective, there will be obvious changes in depth similar to grayscale, making the color variety richer, smoother, and more acceptable. Summary of the Invention
[0004] The problem solved by the present invention is to provide a seven-color image display method based on error diffusion, so that the above-mentioned seven-color electronic paper display screen will have obvious grayscale-like depth changes from a visual perspective, making the color variety richer, smoother, more acceptable, and lower in cost.
[0005] To solve the above problems, the present invention provides a seven-color image display method based on error diffusion, comprising the following steps:
[0006] S1. Convert the target image in RGB format, which displays seven colors (black, white, red, green, blue, yellow, and orange), to HSV format, and preset a threshold t, where the value range of t is: 100≤t≤150;
[0007] S2. Create six sub-images whose pixel arrangement order and number are consistent with those of the target image, and each sub-image is composed of a first color and a second color. The first color is black and fills all the pixels of each sub-image as the background color. The second color is one of the colors white, red, green, blue, yellow, and orange in the target image, and the second color in each sub-image is different. In the target image, the positions of the pixels of the six colors white, red, green, blue, yellow, and orange remain unchanged, and are copied to the six sub-images respectively, covering the black pixels at the corresponding pixel positions.
[0008] S3, taking the first pixel in the second color of each sub-image;
[0009] S4. Divide the sum of the obtained RGB values of the current pixel by 3 to obtain the first value v1 of the current pixel;
[0010] S5, judge the size relationship between v1 and t,
[0011] If v1 ≥ t, the current pixel color remains unchanged and go to S6;
[0012] If v1 < t, assign black to the pixel, take the next pixel of the second color, and go to S4. If all the pixels of the second color on the six sub-images have been taken, go to S7.
[0013] S6, get the second value v2, v2 = v1-255, and take the next pixel of the second color, divide the sum of the RGB values of the current pixel by 3 to get the additional value v, and further get the first value v1' of the current pixel, v1' = v2 / 2+v, and transfer v1' as v1 to S5,
[0014] If all the pixels of the second color on the six sub-images have been taken, go to S7;
[0015] S7. Merge the images to generate a background image whose pixel arrangement order and number are consistent with those of the target image. All pixels of the background image are black. The positions of the six color pixels of white, red, green, blue, yellow, and orange in the six processed sub-images remain unchanged and are copied to the background image to cover the black pixels at the corresponding positions.
[0016] Furthermore, in step S1, t=128.
[0017] The beneficial effects of the present invention are as follows: converting the target image in RGB format into HSV format can make black, white, red, green, blue, yellow and orange appear more intuitive to the human eye; step S5 can make the overall color form a grayscale-like depth and light and dark variation; step S6 can make the overall color form a grayscale-like depth and light and dark variation more obvious; finally, the six adjusted sub-images are re-merged, which can make the color variety of the target image richer, smoother, more acceptable, and at a lower cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 is the target image when the second color is white in the present invention;
[0019] Figure 2 is a sub-image when the second color is white in the present invention; DETAILED DESCRIPTION
[0020] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0021] It should be noted that in order to comply with the relevant provisions of patent examination and the protection of this application, the drawings use pictures with the first color being black and the second color being white for illustration and explanation, and the same applies to the other colors red, green, blue, yellow, and orange. Therefore, color pictures related to red, green, blue, yellow, and orange are not provided in this application; the picture display effect in the drawings is only the effect when adjusted on a computer, and is not the effect finally displayed on the electronic paper display product. It is only for the convenience of describing the present invention and simplifying the description.
[0022] The present invention provides a seven-color picture display method based on error diffusion, comprising the following steps:
[0023] S1. Convert the target image in RGB format, which displays seven colors (black, white, red, green, blue, yellow, and orange), to HSV format, and preset a threshold t, where the value range of t is: 100≤t≤150;
[0024] S2. Create six sub-images whose pixel arrangement order and number are consistent with the target image, and each sub-image is composed of the first color and the second color. The first color is black and fills all the pixels of each sub-image.
[0025] As the background color, the second color is one of the colors in the target image: white, red, green, blue, yellow, or orange. The second color in each sub-image is different. In the target image, the positions of the six pixels of white, red, green, blue, yellow, and orange remain unchanged. They are copied to the six sub-images respectively, covering the black pixels at the corresponding pixel positions.
[0026] S3, taking the first pixel in the second color of each sub-image;
[0027] 0S4. Divide the sum of the RGB values of the current pixel by 3 to obtain the first value v1 of the current pixel;
[0028] S5, judge the size relationship between v1 and t,
[0029] If v1 ≥ t, the current pixel color remains unchanged and go to S6;
[0030] If v1 < t, the pixel is assigned black, the next pixel of the second color is taken, and the process goes to S4.
[0031] If all the pixels of the second color on the six sub-images have been taken, go to S7;
[0032] 5S6, get the second value v2, v2 = v1-255, and take the next pixel of the second color, divide the sum of the RGB values of the current pixel by 3 to get the additional value v, and further get the first value v1' of the current pixel, v1' = v2 / 2+v,
[0033] And v1' is transferred to S5 as v1,
[0034] If all the pixels of the second color on the six sub-images have been taken, go to S7;
[0035] S7. Merge the images to generate a background image whose pixel arrangement order and number are consistent with those of the target image. All pixels of the background image are black. The positions of the six color pixels of white, red, green, blue, yellow, and orange in the six processed sub-images remain unchanged and are copied to the background image to cover the black pixels at the corresponding positions.
[0036] In a preferred embodiment of the present invention, the value of t in step S1 is: t=128. In addition, the value of t in step S1 is:
[0037] The value may also be: t=100 or t=150, as long as the value range of t satisfies: 100≤t≤150.
[0038] It should be noted that the RGB value of the pixel point obtained in S4 is the brightness value of the color of the red, green and blue channels of the pixel point, and the brightness value is represented by an integer from 0 to 255, because each second color is obtained by the change of the color of the red, green and blue channels and their superposition.
[0039] Specifically, the RGB target image is converted to HSV format to accurately read the second color in each sub-image and to still obtain the RGB value of the second color pixel in subsequent calculations. Since E-paper ink screens display a limited number of colors, E-paper ink screens that display seven colors (black, white, red, green, blue, yellow, and orange) are already among the more colorful E-paper ink screens. Therefore, images displayed on these E-paper ink screens only have seven colors (black, white, red, green, blue, yellow, and orange), and these seven colors are also displayed in RGB format. Take a target image in RGB format that displays seven colors (black, white, red, green, blue, yellow, and orange) and convert it to HSV format. It should be noted that converting RGB format to HSV format is a technique well known to those skilled in the art and will not be described in detail here. Set a threshold value t = 128. Create six sub-images with the same resolution as the target image: the first sub-image, the second sub-image, the third sub-image, the fourth sub-image, the fifth sub-image, and the sixth sub-image. All pixels in these six sub-images are filled with black. Keep the white pixel points in the target image fixed, and copy them to the first sub-image to cover the black pixel points at the corresponding positions; keep the red pixel points in the target image fixed, and copy them to the second sub-image to cover the black pixel points at the corresponding positions; keep the green pixel points in the target image fixed, and copy them to the third sub-image to cover the black pixel points at the corresponding positions; keep the blue pixel points in the target image fixed, and copy them to the fourth sub-image to cover the black pixel points at the corresponding positions; keep the yellow pixel points in the target image fixed, and copy them to the fifth sub-image to cover the black pixel points at the corresponding positions; keep the orange pixel points in the target image fixed, and copy them to the sixth sub-image to cover the black pixel points at the corresponding positions. Taking the first sub-image as an example, the first sub-image is as shown in the attached figure. Figure 1 As shown, attached Figure 1The figure shows the state when white forms a rectangle in the upper left corner of the target image, and the white pixels of this shape are copied to the first sub-image without changing their positions to replace the corresponding black pixels. The first pixel of the white pixels is taken, and the sum of the RGB values of the pixel is divided by 3 to obtain the first value v1 of the pixel. The size of v1 is compared with t. If v1 ≥ t, the color of the pixel remains white. If v1 < t, the pixel is assigned black, and the next white pixel is taken and the above steps are repeated until all the white pixels of the first sub-image are taken. ; When v1≥t, get a second value v2, v2=v1-255, and at the same time take a white pixel, divide the sum of the RGB values of the pixel by 3 to get the additional value v, and get the first value v1 belonging to the pixel, v1=v2 / 2+v, and compare the first value v1 belonging to the pixel with t. If v1≥t, the pixel color remains white. If v1<t, the pixel is assigned black, and the next white pixel is taken. Repeat the above steps until all the white pixels of the entire first sub-image are completed. As shown in the attached figure, Figure 2 The first sub-image after adjustment is shown in FIG. The other five sub-images are similar and will not be described in detail.
[0040] Finally, six adjusted sub-images are obtained. These six sub-images are merged to create a background image with the same resolution as the target image. All pixels in the background image are filled with black. The remaining six colors (excluding black) in the six adjusted sub-images (white, red, green, blue, yellow, and orange) are then copied to the background image, overwriting the corresponding black pixels. This results in a merged image. Visually, the merged image exhibits noticeable grayscale-like variations compared to the original target image, resulting in a richer, smoother, and more palatable color palette at a lower cost.
[0041] Although the present disclosure is disclosed as above, the protection scope of the present disclosure is not limited thereto. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present disclosure, and these changes and modifications will fall within the protection scope of the present invention.
Claims
1. A seven-color image display method based on error diffusion, characterized in that: The following steps are involved: S1. Convert the target image in RGB format, which displays seven colors (black, white, red, green, blue, yellow, and orange), to HSV format, and preset a threshold t, where the value range of t is: 100≤t≤150; S2. Create six sub-images whose pixel arrangement order and number are consistent with those of the target image, and each sub-image is composed of a first color and a second color. The first color is black and fills all pixels of each sub-image as the background color. The second color is one of white, red, green, blue, yellow, and orange in the target image, and the second color in each sub-image is different. In the target image, the positions of the pixels of the six colors white, red, green, blue, yellow, and orange remain unchanged, and are copied to the six sub-images respectively to cover the black pixels at the corresponding pixel positions. S3, taking the first pixel in the second color of each sub-image; S4. Divide the sum of the obtained RGB values of the current pixel by 3 to obtain the first value v1 of the current pixel; S5, judge the size relationship between v1 and t, If v1 ≥ t, the current pixel color remains unchanged and go to S6; If v1 < t, the pixel is assigned black, the next pixel of the second color is taken, and the process goes to S4. If all the pixels of the second color on the six sub-images have been taken, go to S7; S6, get the second value v2, v2 = v1-255, and take the next pixel of the second color, divide the sum of the RGB values of the current pixel by 3 to get the additional value v, and further get the first value v1' of the current pixel, v1' = v2 / 2 + v, and pass v1' as v1 to S5, S7. Merge the images to generate a background image whose pixel arrangement order and number are consistent with the target image. All pixels of the background image are black. The positions of the six color pixels of white, red, green, blue, yellow and orange in the six processed sub-images remain unchanged and are copied to the background image to cover the black pixels at the corresponding positions.
2. The seven-color image display method based on error diffusion according to claim 1, characterized in that: In step S1, t=128.
Citation Information
Patent Citations
Image display method of electronic tag and related device
CN111612858A
Color image processing method and device, electronic ink screen and storage medium
CN112598585A