

Dithering takes advantage of the human eye's tendency to "mix" two colors in close proximity to one another.įor 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. 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. The 256 available colors would be used to generate a dithered approximation of the original image. 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. One common application of dithering is to more accurately display graphics containing a greater range of colors than the hardware is capable of showing. Note that even though the same palette is used, the application of dithering gives a better representation of the originalĭisplay 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.

Original image using the web-safe color palette with Floyd–Steinberg dithering. Note the large flat areas and loss of detail.įigure 3. Original image using the web-safe color palette with no dithering applied. Original photo note the smoothness in the detailįigure 2. Dithered images, particularly those with relatively few colors, can often be distinguished by a characteristic graininess, or speckled appearance.įigure 1. The human eye perceives the diffusion as a mixture of the colors within it (see color vision). In a dithered image, colors not available in the palette are approximated by a diffusion of colored pixels from within the available palette. I found values of 0.8 to 1.2 are good for contrast if you want lighten or darken specific areas.Dithering Implementation for Eink D isplay Panelĭithering is a technique used in computer graphics to create the illusion of color depth in images with a limited color palette ( color quantization). Remove the space and surround the argument by quotes. If you want to go negative, I found that specifying the option like -c"-1" will give you minus 1. Negative numbers for contrast invert the image. Numbers larger than 1 increase sharpness/contrast, numbers below 1 reduce it. If image is scaled from the resized pre-dither image if the -r option was specified.įor contrast and sharpness, 1 is default and does not need to be specified. Makes output image twice as large as the pre-dither image. -2: double post-dither image using nearest neighbors.Makes the image smaller only, pre-dithering. -r: resize pre-dither image on longest dimension.-s: boost sharpness by specified amount (in terms of pillow's ImageEnhancers factor: 1 is no change).-c: boost contrast by specified amount (in terms of pillow's ImageEnhancers factor: 1 is no change).-b: start at bottom left instead of top left with the dithering.Must be accepted by PILLOW or it will throw an exception. Otherwise the output is encoded as an RGB file.
