Synonyms

Halftoning

Definition

Image processing algorithm able to simulate the illusion of new colors and shades by varying the pattern of available colors.

In computer graphics, dithering is an image processing operation used to create the illusion of color depth in images with a limited color palette. 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. Dithering is analogous to the halftone technique used in printing [1]. Dithered images, particularly those with relatively few colors, can often be distinguished by a characteristic graininess, or speckled appearance [2]. Color error diffusion is a high-quality method for the color rendering of continuous-tone digital color images on devices with limited color palettes such as low-cost displays and printers. For display applications the input colorant space is a triplet of RGB values and the choice of output levels (i.e., the color palette) is a design parameter.

Dithering methods can be classified into two main categories: threshold dithering and error diffusion dithering. The threshold dithering algorithms compare every pixel in the input image to a threshold value in order to decide which existing color should substitute the given pixel color. Examples of threshold dithering include ordered dithering, stochastic dithering, and dot diffusion dithering. An example error diffusion dithering algorithm was proposed by Floyd and Steinberg [3]. The algorithm scans the image from left to right and top to bottom, quantizing pixel values one by one. In each target pixel location, the quantization error is transferred to the neighboring pixels, while not affecting the pixels that already have been quantized. Dithering a grayscale image in order to display it using a black-and-white device reduces the task of finding the closest color to a simple thresholding operation. In color, it involves matching the input color to the closest available hardware color, which can be difficult depending on the hardware palette. There are many ways to distribute the errors and many ways to scan the image. The different ways of dividing up the error can be obtained using different dithering filters. For example, the Floyd-Steinberg filter is defined as

$$\left[\matrix{0\,p\,7\cr3\,5\,1}\right]\times{1\over 16}$$

where p represents the target or the actual pixel and the numbers, called weights, represent the proportion of the error distributed to the pixel in that position. In addition to good dithering performance (Figure 1), the Floyd-Steinberg filter is computationally efficient as the division by 16 can be replaced by bit shifts.

Dithering. Figure 1.
figure 1_18

Example of error diffusion dithering: (left) original truecolor image with 58885 colors, (middle) nondithered version with 64 colors, and (right) dithered version with 64 colors.

Cross-References

Color-mapped Imaging

Color Quantization

GIF Format

Lossless Compression