Dithering Implementation for Eink Display Panel
by Daiyu Ko, Freescale
a. Dithering in digital image processing
Dithering is a technique used in computer graphics to create the illusion of color depth in images with a limited color palette (color quantization). In a dithered image, colors not available in the palette are approximated by a diffusion of colored pixels from within the available palette. The human eye perceives the diffusion as a mixture of the colors within it (see color vision). Dithered images, particularly those with relatively few colors, can often be distinguished by a characteristic graininess, or speckled appearance.
Figure 1. Original photo; note the smoothness in the detail
Figure 2.Original image using the web-safe color palette with no dithering applied. Note the large flat areas and loss of detail.
Figure 3.Original image using the web-safe color palette with Floyd–Steinberg dithering.
Note that even though the same palette is used, the application of dithering gives a better representation of the original
Display hardware, including early computer video adapters and many modern LCDs used in mobile phonesand inexpensive digital cameras, show a much smaller color range than more advanced displays. One common application of dithering is to more accurately display graphics containing a greater range of colors than the hardware is capable of showing. For example, dithering might be used in order to display a photographic image containing millions of colors on video hardware that is only capable of showing 256 colors at a time. The 256 available colors would be used to generate a dithered approximation of the original image. Without dithering, the colors in the original image might simply be "rounded off" to the closest available color, resulting in a new image that is a poor representation of the original. Dithering takes advantage of the human eye's tendency to "mix" two colors in close proximity to one another.
For Eink panel, since it is grayscale image only, we can use the dithering algorism to reduce the grayscale level even to black/white only but still get better visual results.
There are several algorithms designed to perform dithering. One of the earliest, and still one of the most popular, is the Floyd–Steinberg dithering algorithm, developed in 1975. One of the strengths of this algorithm is that it minimizes visual artifacts through an error-diffusion process; error-diffusion algorithms typically produce images that more closely represent the original than simpler dithering algorithms.
Error-diffusion dithering is a feedback process that diffuses the quantization error to neighboring pixels.
- Floyd–Steinberg dithering only diffuses the error to neighboring pixels. This results in very fine-grained dithering.
- Jarvis, Judice, and Ninke dithering diffuses the error also to pixels one step further away. The dithering is coarser, but has fewer visual artifacts. It is slower than Floyd–Steinberg dithering because it distributes errors among 12 nearby pixels instead of 4 nearby pixels for Floyd–Steinberg.
- Stucki dithering is based on the above, but is slightly faster. Its output tends to be clean and sharp.
Error-diffusion dithering (continued):
- Sierra dithering is based on Jarvis dithering, but it's faster while giving similar results.
- Filter Lite is an algorithm by Sierra that is much simpler and faster than Floyd–Steinberg, while still yielding similar (according to Sierra, better) results.
- Atkinson dithering, developed by Apple programmer Bill Atkinson, resembles Jarvis dithering and Sierra dithering, but it's faster. Another difference is that it doesn't diffuse the entire quantization error, but only three quarters. It tends to preserve detail well, but very light and dark areas may appear blown out.
2. Eink display panel characteristic
a. Low resolution
Eink only has couple resolution modes for display
DU (1bit, Black/White)
GC4 (2bit, Gray scale)
GC16 (4bit, Gray scale)
A2 (1bit, Black/White, fast update mode)
b. Slow update time
For 800x600 panel size (per frame)
3. 3. Effect by doing dithering for Eink display panel
a. Low resolution with better visual quality
By doing dithering to the original grayscale image, we can get better visual looking result. Even if the image becomes black and white image, with the dithering algorism, you will still get the feeling of grayscale image.
b. Faster update with Eink’s animation waveform
Since the DU/A2 mode could update the Eink panel faster than grayscale mode, with dithering, we can get no only the better visual looking result, but also we can use DU/A2 fast update mode to show animation or even normal video files.
4. 4. Our current dithering implementation
a. Choose a simple and effective algorism
Considering Eink panel’s characteristics, we compared couple dithering algorism and decide to use Atkinson dithering algorism. It is simple and the result is better especially for Einkblack/white display case.
b. Made a lot of optimization so that it will not affect update time too much
With the simplicity of the Atkinson dithering algorism, we can also put a lot of effort to do the optimization in order to reduce the dithering processing time and make it practical for actual use.
c. Current algorism performance and result
Currently, with Atkinson dithering algorism, our processing time is about 70ms.
5. 5. Availability
a. We implemented both Y8->Y1 and Y8->Y4 dithering with the same dithering algorism.
b. Implemented into our EPDC driver with i.MX6SL Linux 3.0.35 version release.
c. Also implemented in our Video for Eink demo
6. 6. References
a. Part of dithering introduction from www.wikipedia.org