A multi-grayscale dithering method to improve EPD grayscale
By dividing the image of the electronic paper display into multiple sub-images according to the grayscale value range and performing dithering algorithm processing, the problem that the grayscale of the electronic paper display can only achieve black and white brightness is solved, and a more delicate multi-grayscale display is achieved.
Patent Information
- Application Number
- CN202211731056.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2042-12-30
AI Technical Summary
In the prior art, the grayscale of electronic paper displays can only achieve black and white brightness display, resulting in a strong sense of graininess in the image and unable to achieve a delicate display.
Divide an image into multiple sub-images according to the average grayscale value range of the pixel group, and perform a jitter algorithm on each sub-image to make the pixel brightness of each sub-image different. A multi-grayscale effect is achieved by over-displaying different brightness levels.
Through the multi-grayscale dithering method, the graininess of the image is reduced, achieving a more delicate display effect.
Smart Images

Figure CN116012246B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic paper module display, and in particular to a multi-grayscale dithering method for improving the grayscale of an EPD. Background Art
[0002] As electronic paper becomes more and more popular, the images it displays also need to show more delicate image quality. In traditional image processing, the pixel dithering algorithm is generally used to process the pixels of the entire image, specifically:
[0003] First, all pixels in the entire image are divided into multiple pixel groups, each of which includes 4×4 pixels. The entire image is grouped using this 16-grayscale method. Then, the actual grayscale value of each pixel in each pixel group is read, and the average grayscale value of the pixel group is calculated. Finally, each pixel in the pixel group is compensated, so that only pixels with a grayscale value of 0 are displayed black, and pixels with a grayscale value of 255 are displayed white, ensuring that the average grayscale value of the pixel group remains unchanged before and after compensation.
[0004] This way, areas that originally appeared darker in the image have lower average grayscale values, and the dithering algorithm results in a higher density of black dots in those areas. Areas that originally appeared whiter in the image also have higher average grayscale values, and the dithering algorithm also results in a lower density of black dots in those areas. The dithering algorithm actually achieves grayscale display by varying the density of black or white dots, or more accurately, by varying the brightness of an area.
[0005] However, the existing pixel dithering algorithm produces severe graininess and large gaps when the image is magnified. Therefore, an 8-grayscale or 4-grayscale algorithm is used to reduce the number of pixels in each pixel group to achieve a low grayscale and thus reduce the gaps. However, this one-time image processing method effectively only displays black and white brightness, resulting in a very strong grainy image and failing to achieve a detailed image display. Summary of the Invention
[0006] The technical problem to be solved by the present invention is to provide a multi-grayscale dithering method for improving the grayscale of EPD, so as to solve the problem in the prior art that only black and white brightness display makes the picture very grainy.
[0007] The technical solution adopted by the present invention to solve the above problem is: a multi-grayscale dithering method for improving the grayscale of EPD, comprising the following steps:
[0008] S1. Select a picture with a resolution of M×N;
[0009] S2. Divide the image into several rectangular pixel groups, each pixel group includes x×y pixels, and record the average grayscale value of the pixels in each pixel group;
[0010] S3. Divide the image into n sub-images according to the average grayscale value, where the average grayscale value interval of each pixel group in the i-th sub-image is \left [ {\frac {256\times (i-1)} {n}, \frac {256\times i} {n}-1} \right ] ;
[0011] S4. Perform a pixel dithering algorithm on each sub-image to calculate the number of pixels showing white dots and black dots in each pixel group in each sub-image. The brightness value of all pixels showing white dots in each pixel group in the i-th sub-image is recorded as a, and the brightness value of all pixels showing black dots is recorded as a-1.
[0012] S5. Read the brightness values of all pixels on each sub-image, and light up the corresponding pixels of the image according to the brightness values;
[0013] Wherein, M is a multiple of x; N is a multiple of y; n is a factor of 256; i is a positive integer not greater than n; a=i.
[0014] Compared with the existing technology, the advantages of the present invention are: dividing a picture into n sub-pictures according to the average grayscale value range of the pixel group, and then performing a jitter algorithm on each sub-picture so that the brightness of the pixels of each sub-picture is different, and then reading the brightness values of all pixels. Through the excessive display of different brightness, the picture display is guaranteed to be more delicate and the granularity intensity of the picture is reduced.
[0015] Preferably, in step S4, the following steps are specifically included:
[0016] S41, i=1;
[0017] S42, read the average grayscale value A corresponding to each pixel group in the i-th sub-image, and set the number of pixels showing white points in each pixel group to be The number of pixels showing black dots is indivual;
[0018] The grayscale value of the pixel showing the white point is ;
[0019] The grayscale value of the pixel showing the black point is ;
[0020] ;
[0021] Simplified:
[0022] ;
[0023] By rounding the function Rounding off the value, the actual number of pixels showing white points in each pixel group is k:
[0024] k=\left [ {{k}^{'}+0.5} \right ] ;
[0025] Record the number k and position of pixels that actually display white dots, and the number (x×yk) and position of pixels that actually display black dots in each pixel group;
[0026] S43, in each pixel group in the i-th sub-image, the brightness value of all pixels showing white dots is recorded as a, and the brightness value of all pixels showing black dots is recorded as a-1;
[0027] S44, i=i+1;
[0028] S45. Determine whether i is greater than n; if so, go to step S5; if not, return to step S42.
[0029] The technical effect achieved by adopting this technical solution is as follows: in each sub-image, according to the average grayscale value of each pixel group, the pixel group is divided into only white points and black points, and then the number and position of the corresponding white points are counted, and the brightness value of the corresponding white points of each sub-image is recorded, so that the brightness value of each sub-image is different.
[0030] Preferably, in step S42 , the k pixels in each pixel group that actually display white points are the k pixels with the highest actual grayscale values in the pixel group.
[0031] The technical effect achieved by adopting this technical solution is: using the k pixels with the highest actual grayscale values as the k pixels that actually display white points, it is possible to compensate the grayscale values of these k pixels in the shortest time and then display white points.
[0032] Preferably, the value of x×y is 2, 4, 8 or 16.
[0033] The technical effect achieved by adopting this technical solution is: it is easy to realize 2 grayscale, 4 grayscale, 8 grayscale or 16 grayscale display, and can realize corresponding grayscale processing according to the resolution of the actual picture.
[0034] Preferably, x=y=4.
[0035] The technical effect achieved by adopting this technical solution is: grayscale processing is performed according to 4×4 pixel groups, which is easy to implement.
[0036] Preferably, n=4.
[0037] The technical effect achieved by adopting this technical solution is: a picture is divided into four sub-pictures for easy processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 This is an overall flow chart of a multi-grayscale dithering method for improving EPD grayscale according to the present invention;
[0039] Figure 2 This is a specific flow chart of step S4 in a multi-grayscale dithering method for improving EPD grayscale according to the present invention. DETAILED DESCRIPTION
[0040] 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.
[0041] like Figure 1 As shown, this embodiment relates to a multi-grayscale dithering method for improving the grayscale of an EPD, comprising the following steps:
[0042] S1. Select a picture with a resolution of M×N;
[0043] S2. Divide the image into several rectangular pixel groups, each pixel group includes x×y pixels, and record the average grayscale value of the pixels in each pixel group;
[0044] S3. Divide the image into n sub-images according to the average grayscale value. The average grayscale value interval of each pixel group in the i-th sub-image is \left [ {\frac {256\times (i-1)} {n}, \frac {256\times i} {n}-1} \right ] ;
[0045] S4. Perform a pixel dithering algorithm on each sub-image to calculate the number of pixels showing white dots and black dots in each pixel group in each sub-image. The brightness value of all pixels showing white dots in each pixel group in the i-th sub-image is recorded as a, and the brightness value of all pixels showing black dots is recorded as a-1.
[0046] S5. Read the brightness values of all pixels on each sub-image and light up the corresponding pixels on the image according to the brightness values;
[0047] Wherein, M is a multiple of x; N is a multiple of y; n is a factor of 256; i is a positive integer not greater than n; a=i.
[0048] An image is divided into n sub-images according to the average grayscale value range of the pixel group. Then, each sub-image is processed with a jitter algorithm to make the brightness of the pixels in each sub-image different. Then, the brightness values of all pixels are read. By over-displaying different brightness levels, the image display is guaranteed to be more delicate and the intensity of the graininess of the image is reduced.
[0049] Among them, see Figure 2 As shown, in step S4, the following steps are specifically included:
[0050] S41, i=1;
[0051] S42, read the average grayscale value A corresponding to each pixel group in the i-th sub-image, and set the number of pixels showing white points in each pixel group to be The number of pixels showing black dots is indivual;
[0052] The grayscale value of the pixel showing the white point is ;
[0053] The grayscale value of the pixel showing the black point is ;
[0054] ;
[0055] Simplified:
[0056] ;
[0057] By rounding the function Rounding off the value, the number of pixels that actually display white points in each pixel group is k:
[0058] k=\left [ {{k}^{'}+0.5} \right ] ;
[0059] Record the number k and position of pixels that actually display white dots, and the number (x×yk) and position of pixels that actually display black dots in each pixel group;
[0060] S43, in each pixel group in the i-th sub-image, the brightness value of all pixels showing white dots is recorded as a, and the brightness value of all pixels showing black dots is recorded as a-1;
[0061] S44, i=i+1;
[0062] S45. Determine whether i is greater than n; if so, go to step S5; if not, return to step S42.
[0063] In each sub-image, the pixel group is divided into white dots and black dots according to the average grayscale value of each pixel group. The number and position of the corresponding white dots are then counted, and the brightness value of the corresponding white dots in each sub-image is recorded, so that the brightness value of each sub-image is different.
[0064] Furthermore, in step S42 , the k pixels in each pixel group that actually display white points are the k pixels with the highest actual grayscale values in the pixel group.
[0065] In the actual pixel lighting process, the display is based on the grayscale value. Therefore, the k pixels with the highest actual grayscale values are used as the k pixels that actually display the white point. This can achieve the shortest time to compensate the grayscale values of these k pixels and then display the white point.
[0066] In this embodiment, the value of x×y is 2, 4, 8 or 16. This facilitates the realization of 2-grayscale, 4-grayscale, 8-grayscale or 16-grayscale display, and can implement corresponding grayscale processing according to the resolution of the actual image.
[0067] As one implementation, x = y = 4, n = 4. In this case, the average grayscale value interval of each pixel group in the first sub-image is [0, 63]; the average grayscale value interval of each pixel group in the second sub-image is [64, 127]; the average grayscale value interval of each pixel group in the third sub-image is [128, 195]; and the average grayscale value interval of each pixel group in the fourth sub-image is [196, 255].
[0068] If the actual grayscale values of the pixels in one pixel group of the second sub-image are actually detected as shown in Table 1, the average grayscale value A corresponding to the pixel group is calculated to be 100.
[0069] Table 1 Actual grayscale values of each pixel in one pixel group of the second sub-image
[0070] 88 120 97 115 64 110 87 108 76 93 127 115 100 85 90 125
[0071] Then, the number of pixels showing white dots in this pixel group is :
[0072] ;
[0073] The number of pixels that actually display white points in this pixel group is k:
[0074] k=\left [ {{k}^{'}+0.5} \right ]=[9.14+0.5]=[9.64]=9 ;
[0075] Therefore, the number of pixels in this pixel group that actually display black dots is 4 × 4 - 9 = 7. Of the 16 pixels in this pixel group, 9 display white dots and 7 display black dots. The brightness values of these 9 pixels displaying white dots are recorded as 2, and the brightness values of the 7 pixels displaying black dots are recorded as 1. The brightness values of each pixel in this pixel group are shown in Table 2.
[0076] Table 2 Brightness values of each pixel in the pixel group of the second sub-image
[0077] 1 2 2 2 1 2 1 2 1 1 2 2 2 1 1 2
[0078] Similarly, if the average grayscale value of each pixel in one pixel group of the first sub-image is 40, then after the above calculation, 10 white dots and 6 black dots are obtained. Then, when the brightness is finally displayed, 10 pixels display a brightness value of 1 and 6 pixels display a brightness value of 0.
[0079] The beneficial effects of the present invention are: dividing a picture into n sub-pictures according to the average grayscale value range of the pixel group, and then performing a jitter algorithm on each sub-picture so that the brightness of the pixels of each sub-picture is different, and then reading the brightness values of all pixels. Through the excessive display of different brightnesses, the picture display is ensured to be more delicate and the granularity intensity of the picture is reduced.
[0080] The foregoing description shows and describes several preferred embodiments of the present invention. However, as previously stated, it should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. Rather, the present invention can be used in various other combinations, modifications, and environments and can be modified within the scope of the inventive concept described herein by the teachings above or by techniques or knowledge in the relevant art. Modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention are intended to be within the scope of the appended claims.
[0081] 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 multi-grayscale dithering method for improving EPD grayscale, characterized by: The steps include: S1. Select a picture with a resolution of M×N; S2. Divide the image into several rectangular pixel groups, each pixel group includes x×y pixels, and record the average grayscale value of the pixels in each pixel group; S3, dividing the image into n sub-images according to the average grayscale value, and the average grayscale value interval of each pixel group in the i-th sub-image is ; S4. Perform a pixel dithering algorithm on each sub-image to calculate the number of pixels showing white dots and black dots in each pixel group in each sub-image. The brightness value of all pixels showing white dots in each pixel group in the i-th sub-image is recorded as a, and the brightness value of all pixels showing black dots is recorded as a-1. S5. Read the brightness values of all pixels on each sub-image, and light up the corresponding pixels of the image according to the brightness values; Wherein, M is a multiple of x; N is a multiple of y; n is a factor of 256; i is a positive integer not greater than n; a=i.
2. The multi-grayscale dithering method for improving EPD grayscale according to claim 1, characterized in that: In step S4, the following steps are specifically included: S41, i=1; S42, read the average grayscale value A corresponding to each pixel group in the i-th sub-image, and set the number of pixels showing white points in each pixel group to be The number of pixels showing black dots is indivual; The grayscale value of the pixel showing the white point is ; The grayscale value of the pixel showing the black point is ; ; Simplified: ; By rounding the function Rounding off the value, the actual number of pixels showing white points in each pixel group is k: ; Record the number k and position of pixels that actually display white dots, and the number (x×yk) and position of pixels that actually display black dots in each pixel group; S43, in each pixel group in the i-th sub-image, the brightness value of all pixels showing white dots is recorded as a, and the brightness value of all pixels showing black dots is recorded as a-1; S44, i=i+1; S45. Determine whether i is greater than n; if so, go to step S5; if not, return to step S42.
3. The multi-grayscale dithering method for improving EPD grayscale according to claim 2, characterized in that: In step S42 , the k pixels in each pixel group that actually display white points are the k pixels in the pixel group with the highest actual grayscale values.
4. The multi-grayscale dithering method for improving EPD grayscale according to claim 3, characterized in that: The value of x×y is 2, 4, 8 or 16.
5. The multi-grayscale dithering method for improving EPD grayscale according to claim 3, characterized in that: Said x=y=4.
6. A multi-grayscale dithering method for improving EPD grayscale according to claim 4 or 5, characterized in that: Said n=4.
Citation Information
Patent Citations
Method and device for adjusting image display
CN101923823A
Method and device for determining luminance compensation coefficients
CN105529002A