An image display method based on error diffusion

By dividing the grayscale levels of the black, white, red and yellow four-color electronic paper display screen by interval and assigning colors in the pixel matrix using the error diffusion method, the problem of single color is solved and a rich visual color effect is achieved.

CN116524833BActive Publication Date: 2025-08-01JIANGXI XINGTAI TECH INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211451928.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-21
Publication Date
2025-08-01
Estimated Expiration
2042-11-21

AI Technical Summary

Technical Problem

The existing black, white, red and yellow electronic paper display screen has a single color, resulting in insufficient color and insufficient visual effect.

Method used

The 256 grayscale colors of black, white, red and yellow are divided into different intervals according to the grayscale values, and different numbers of color elements are allocated in the pixel matrix through the error diffusion method, so that the average grayscale value of each sub-matrix falls into the corresponding color interval, realizing the hierarchical change of color.

Benefits of technology

Through the error diffusion method, the black, white, red and yellow four-color display screen visually shows rich color layers and gentle tone changes, which improves the acceptance of color.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure HDA0003951905820000011
    Figure HDA0003951905820000011
  • Figure HDA0003951905820000012
    Figure HDA0003951905820000012
  • Figure HDA0003951905820000021
    Figure HDA0003951905820000021
Patent Text Reader

Abstract

The present invention provides a picture display method based on error diffusion. By dividing the intervals of black, white, red, and yellow through gray values, and dividing the entire pixel picture into different sub-matrices, calculating the average value of the total gray values of each sub-matrix, determining which interval each average value falls into, and then performing corresponding coloring on each element in the sub-matrix; making the color of the display screen that only displays black, white, red, and yellow look richer, smoother, and more acceptable visually.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing, and more particularly, to a method for displaying pictures based on error diffusion. Background Art

[0002] In life, many display screens only show black, white, red, and yellow colors, such as black, white, red, and yellow four-color electronic paper display screens. Since this electronic paper display screen only shows a single black, white, red, and yellow four-color, the colorfulness is very single.

[0003] Error diffusion is to spread the error of pixel change when the color depth is reduced, so that when the human eye observes a picture, the overall error of adjacent pixel points becomes smaller. In this way, from a visual perspective, the color types will be richer, smoother, and easier to accept. Summary of the Invention

[0004] The problem solved by the present invention is to provide a method for displaying pictures based on error diffusion, so that the colors of a display screen that only shows black, white, red, and yellow look richer, smoother, and easier to accept visually.

[0005] To solve the above problems, the present invention provides a method for displaying pictures based on error diffusion, which is characterized by including the following steps:

[0006] S1. Divide the black, white, red, and yellow four colors with 256 gray levels into the following according to the gray value on average:

[0007] Black interval, the gray value range is: 0 - 63;

[0008] Red interval, the gray value range is: 64 - 127;

[0009] Yellow interval, the gray value range is: 128 - 191;

[0010] White interval, the gray value range is: 192 - 255;

[0011] S2. Divide the black interval, white interval, red interval, and yellow interval into four sub-intervals according to the gray value respectively:

[0012] The four sub-intervals of the black interval are: light interval is 0 - 15, relatively light interval is 16 - 31, relatively dark interval is 32 - 47, and dark interval is 48 - 63;

[0013] The four sub-intervals of the red interval are: light interval is 64 - 79, relatively light interval is 80 - 95, relatively dark interval is 96 - 111, and dark interval is 112 - 127;

[0014] The four sub - intervals of the yellow range are: the light interval is 128 - 143, the relatively light interval is 144 - 159, the relatively dark interval is 160 - 175, and the dark interval is 176 - 191;

[0015] The four sub - intervals of the white range are: the light interval is 192 - 207, the relatively light interval is 208 - 223, the relatively dark interval is 224 - 239, and the dark interval is 240 - 255;

[0016] S3. Divide the target picture into a pixel matrix A according to the number of rows and columns of the pixels. The number of rows and columns of the pixel matrix A is the same as that of the target picture;

[0017] S4. Starting from the element in the first row and first column of the pixel matrix A, take a sub - matrix a with 4×4 rows and columns. If the number of rows and columns is less than 4×4, skip it without processing until the entire pixel matrix A is taken;

[0018] S5. Calculate the average value of the total gray - scale values of all elements in each sub - matrix a. If the total gray - scale value cannot be divided evenly, round it to the nearest integer; determine which interval in step S1 and which sub - interval in step S2 the respective average values fall into;

[0019] S6. According to the sub - interval into which the average value falls, assign different numbers of units of the color belonging to that interval to the elements in the corresponding sub - matrix a; among them, if the average value falls into the light interval, assign the color of that interval to one of the 1 elements in the corresponding sub - matrix a; if the average value falls into the relatively light interval, assign the color of that interval to 6 of the elements in the corresponding sub - matrix a; if the average value falls into the relatively dark interval, assign the color of that interval to 10 of the elements in the corresponding sub - matrix a; if the average value falls into the dark interval, assign the color of that interval to 16 of the elements in the corresponding sub - matrix a.

[0020] Further, in step S6, define a ij to represent the element in the i - th row and j - th column of the sub - matrix a. The color of 1 element is assigned to the a 11 element in the corresponding sub - matrix a; the color of 6 elements is assigned to the a 11 、a 12 、a 13 、a 21 、a 22 、a 31 elements in the corresponding sub - matrix; the color of 10 elements is assigned to the a 11 、a 12 、a 13 、a 14 、a 21 、a 22 、a 23 、a 31 、a32 and a 41 element; the colors of 16 elements are assigned to all elements of the corresponding sub - matrix a.

[0021] The beneficial effects brought by the present invention are as follows: by calculating the average value of the total gray - scale values of each element in each sub - matrix a, and then allocating colors according to which sub - interval each average value falls into, the four colors of black, white, red, and yellow have shades similar to gray levels, rather than simply showing the four colors of black, white, red, and yellow. This makes the display of the four colors of black, white, red, and yellow more hierarchical, richer, smoother, and easier to accept visually. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 is a schematic diagram of the pixel matrix A and the sub - matrix a of the present invention;

[0023] Figure 2 is a schematic diagram of coloring the a 11 element in the sub - matrix a of the present invention;

[0024] Figure 3 is a schematic diagram of coloring the a 11 and a 12 and a 13 and a 21 and a 22 and a 31 elements in the sub - matrix a of the present invention;

[0025] Figure 4 is a schematic diagram of coloring the a 11 and a 12 and a 13 and a 14 and a 21 and a 22 and a 23 and a 31 and a 32 and a 41 elements in the sub - matrix a of the present invention;

[0026] Figure 5 is a schematic diagram of coloring all elements in the sub - matrix a of the present invention; DETAILED DESCRIPTION OF THE INVENTION

[0027] To make the above - mentioned objects, features, and advantages of the present invention more obvious and understandable, the following detailed description of the specific embodiments of the present invention will be given with reference to the accompanying drawings.

[0028] It should be noted that in Figure 3 to Figure 5 in the accompanying drawings, in order to clearly show that colors are assigned to each element in the sub - matrix a, a solid circle is used to represent that the color is assigned to the element, and in actual use, the entire element presents that color, as shown in Figure 3As shown, attached Figure 3 The expression is that the elements of the first row and first column of the submatrix a are given a color. In actual use, the elements of the first row and first column of the submatrix a are all in the same color, rather than the circles in the attached figure. Figure 4 , Attachment Figure 5 Similarly, the above is only for the purpose of clearly expressing the technical solution of the present invention and cannot be considered as a limitation of the present invention.

[0029] The present invention provides a picture display method based on error diffusion, comprising the following steps:

[0030] S1. Divide the four colors of black, white, red and yellow with 256 gray levels into the following:

[0031] Black range, grayscale value range: 0-63;

[0032] Red zone, grayscale value range: 64-127;

[0033] Yellow zone, grayscale value range: 128-191;

[0034] White interval, grayscale value range: 192-255;

[0035] S2. Divide the black interval, white interval, red interval, and yellow interval into four sub-intervals according to their grayscale values:

[0036] The four subranges of the black range are: light range 0-15, lighter range 16-31, darker range 32-47, and darker range 48-63;

[0037] The four subranges of the red range are: light range 64-79, lighter range 80-95, darker range 96-111, and dark range 112-127;

[0038] The four subranges of the yellow range are: light range 128-143, lighter range 144-159, darker range 160-175, and dark range 176-191;

[0039] The four subranges of the white range are: the light range is 192-207, the lighter range is 208-223, the darker range is 224-239, and the dark range is 240-255;

[0040] S3. Divide the target image into a pixel matrix A according to the number of rows and columns of pixels, where the number of rows and columns of the pixel matrix A is consistent with the number of rows and columns of the target image;

[0041] S4. Starting from the first row and first column element in the pixel matrix A, a submatrix a with a number of rows and columns of 4×4 is obtained. If the number of rows and columns is less than 4×4, it is skipped and not processed until the entire pixel matrix A is obtained;

[0042] S5. Calculate the average value of the total gray values of all elements in each sub-matrix a. If the total gray value cannot be divided evenly, round it to the nearest integer. Determine which interval in step S1 and which sub-interval in step S2 each average value falls into.

[0043] S6. According to the sub-interval into which the average value falls, assign colors belonging to that interval with different unit numbers to the elements in the corresponding sub-matrix a. Specifically, if the average value falls into the light interval, assign the color of that interval to one of the elements in the corresponding sub-matrix a; if the average value falls into the relatively light interval, assign the color of that interval to six of the elements in the corresponding sub-matrix a; if the average value falls into the relatively dark interval, assign the color of that interval to ten of the elements in the corresponding sub-matrix a; if the average value falls into the dark interval, assign the color of that interval to sixteen of the elements in the corresponding sub-matrix a.

[0044] In a preferred embodiment of the present invention, in step S6, as shown in Figure 2 to Figure 5 shown, define a ij to represent the element in the i-th row and j-th column of the sub-matrix a. The color of one element is assigned to the a 11 element in the corresponding sub-matrix a; the color of six elements is assigned to the a 11 , a 12 , a 13 , a 21 , a 22 , a 31 [[ID= 28]]elements in the corresponding sub-matrix; the color of ten elements is assigned to the a 11 , a 12 , a 13 , a 14 , a 21 , a 22 , a 23 , a 31 , a 32 , a 41 elements in the corresponding sub-matrix; the color of sixteen elements is assigned to all elements in the corresponding sub-matrix a.

[0045] The division of the four sub-intervals is such that the smaller the value, the lighter the color, and the larger the value, the darker the color.

[0046] Specifically, as shown in Figure 1 to Figure 5As shown, for example, if the target picture is 800 * 600 pixels, then the target picture can be divided into a pixel matrix A of 800 rows and 600 columns. Starting from the element in the first row and first column, take a sub - matrix a with a row - column number of 4×4. After taking the first 4×4 sub - matrix a, then take the next 4×4 sub - matrix a in sequence along the horizontal or vertical direction until the entire pixel matrix A is taken. Since the picture resolutions are different, if the resolution size results in a sub - matrix a that does not satisfy 4×4, then all are skipped without processing and the original color remains unchanged; sum up the gray - scale values of each element in each 4×4 sub - matrix a and take the average value, and judge which interval among the black interval, white interval, red interval, and yellow interval the average value is in, and further judge which sub - interval among the light interval, lighter interval, darker interval, and dark interval in the above four intervals; for example: if the sum of the gray - scale values of the first 4×4 sub - matrix a is 2080, then the average gray - scale value of this sub - matrix a is 2080 / 16 = 130. It can be judged that 130 is in the yellow interval, and at the same time, it can be judged that 130 is in the light sub - interval of the yellow interval. Then, as shown in the appendix Figure 2 As shown, assign yellow to the element in the first row and first column of this sub - matrix a, that is, assign yellow to the a 11 element of this sub - matrix a, and do not assign color to the remaining elements; take the second sub - matrix a along the horizontal or vertical direction. For example, if the sum of the gray - scale values of the second sub - matrix a is 400, then the average gray - scale value of this sub - matrix a is 400 / 16 = 25. It can be judged that 25 is in the black interval, and at the same time, it can be judged that 25 is in the lighter sub - interval of the yellow interval. Then, as shown in the appendix Figure 3 As shown, in the a 11 、a 12 、a 13 、a 21 、a 22 、a 31 elements of this sub - matrix a, assign black, and do not assign color to the remaining elements; take the third sub - matrix a along the original direction. For example, if the sum of the gray - scale values of the third sub - matrix a is 1623, then the average gray - scale value of this sub - matrix a is 1623 / 16 = 101.4, rounded to the nearest integer is 101. It can be judged that 101 is in the red interval, and at the same time, it can be judged that 101 is in the darker sub - interval of the red interval. Then, as shown in the appendix Figure 4 As shown, in the a 11 、a 12 、a 13 、a 14 、a 21 、a 22 、a 23 、a 31 、a 32 、a 41The element is given red, and the remaining elements are not given colors; continue to take the fourth sub-matrix a in the original direction. For example, if the sum of the grayscale values of the fourth sub-matrix a is 3997, then the average grayscale value of this sub-matrix a is 3997 / 16 = 249.8, which is rounded up to 250. It can be judged that 250 is in the white interval, and at the same time, it can be judged that 250 is in the deep interval of the white interval, then attach Figure 5 As shown, white is given to all elements of this sub-matrix a; similarly, by analogy, until the entire pixel matrix A is taken, which will not be elaborated here.

[0047] The present invention can enable a display screen with four colors of black, white, red, and yellow to give different degrees of colors to each pixel according to the change of the average grayscale value, so as to achieve color control, making the color of the display screen that only shows four colors of black, white, red, and yellow look richer, smoother, and more acceptable visually.

[0048] 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 all fall within the protection scope of the present invention.

Claims

1. A method for displaying pictures based on error diffusion, characterized in that Including the following steps: S1. Divide the black, red, yellow, and white colors with 256 gray levels into the following ranges according to the average gray value: Black range, the gray value range is: 0 - 63; Red range, the gray value range is: 64 - 127; Yellow range, the gray value range is: 128 - 191; White range, the gray value range is: 192 - 255; S2. Divide the black range, white range, red range, and yellow range into four sub - ranges respectively according to the gray value: The four sub - ranges of the black range are: light range is 0 - 15, relatively light range is 16 - 31, relatively dark range is 32 - 47, and dark range is 48 - 63; The four sub - ranges of the red range are: light range is 64 - 79, relatively light range is 80 - 95, relatively dark range is 96 - 111, and dark range is 112 - 127; The four sub - ranges of the yellow range are: light range is 128 - 143, relatively light range is 144 - 159, relatively dark range is 160 - 175, and dark range is 176 - 191; The four sub - ranges of the white range are: light range is 192 - 207, relatively light range is 208 - 223, relatively dark range is 224 - 239, and dark range is 240 - 255; S3. Divide the target image into a pixel matrix A according to the number of rows and columns of the pixels. The number of rows and columns of the pixel matrix A is the same as that of the target image; S4. Starting from the element in the first row and first column of the pixel matrix A, take a sub - matrix a with 4×4 rows and columns. If the number of rows and columns is less than 4×4, skip it and do not process it until the entire pixel matrix A is taken; S5. Calculate the average value of the total gray values of all elements in each sub - matrix a. If the total gray value cannot be divided evenly, round it to the nearest integer; determine which range in step S1 and which sub - range in step S2 the average values fall into; S6. According to the sub - range into which the average value falls, assign different numbers of colors belonging to this range to each element in the corresponding sub - matrix a. Among them, if the average value falls into the light range, assign the color of this range to one of the elements in the corresponding sub - matrix a; if the average value falls into the relatively light range, assign the color of this range to six elements in the corresponding sub - matrix a; if the average value falls into the relatively dark range, assign the color of this range to ten elements in the corresponding sub - matrix a; if the average value falls into the dark range, assign the color of this range to sixteen elements in the corresponding sub - matrix a.

2. The picture display method based on error diffusion according to claim 1, characterized in that In step S6, define a ij to represent the element in the i-th row and j-th column of the sub-matrix a, and the color of the said 1 element is assigned to the a 11 element in the corresponding sub-matrix a; the color of the said 6 elements is assigned to the a 11 and a 12 and a 13 and a 21 and a 22 and a 31 elements in the corresponding sub-matrix a; the color of the said 10 elements is assigned to the a 11 and a 12 and a 13 and a 14 and a 21 and a 22 and a 23 and a 31 and a 32 and a 41 elements in the corresponding sub-matrix a; the color of the said 16 elements is then assigned to all elements in the corresponding sub-matrix a.

Citation Information

Patent Citations

  • Contrast enhancement method for uniformly distributing image brightness

    CN101286231A

  • Adaptive color error diffusion method

    KR1020000051141A