kids encyclopedia robot

Dither facts for kids

Kids Encyclopedia Facts

Dithering is the intentional use of noise (random sounds) to reduce the error of compression.

Dither is an applied form of noise used to randomize quantization error, preventing large-scale patterns such as color banding in images. Dither is routinely used in processing of both digital audio and video data, and is often one of the last stages of mastering audio to a CD.

A typical use of dither is converting a greyscale image to black and white, such that the density of black dots in the new image approximates the average grey level in the original.

Digital photography and image processing

Dithering example red blue
An illustration of dithering. Red and blue are the only colors used but, as the red and blue squares are made smaller, the patch appears purple.
256colortestthing
256 color dithering with IrfanView

Dithering is used in computer graphics to create the illusion of "color depth" in images with a limited color palette - a technique also known as color quantization. In a dithered image, colors that are 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.

By its nature, dithering introduces pattern into an image - the theory being that the image will be viewed from such a distance that the pattern is not discernible to the human eye. Unfortunately this is often not the case, and often the patterning is visible - for example, often with images found on the web. In these circumstances it has been shown that a blue noise dither pattern is the least unsightly and distracting. The error diffusion techniques were some of the first methods to generate blue noise dithering patterns. However, other techniques such as ordered dithering can also generate blue noise dithering without the tendency to degenerate into areas with artifacts.

Examples

Color dithering on a towel
Color dithering on a towel

Reducing the color depth of an image can often have significant visual side-effects. If the original image is a photograph, it is likely to have thousands, or even millions of distinct colors. The process of constraining the available colors to a specific color palette effectively throws away a certain amount of color information.

A number of factors can affect the resulting quality of a color-reduced image. Perhaps most significant is the color palette that will be used in the reduced image. For example, an original image (Figure 1) may be reduced to the 216-color "web-safe" color palette. If the original pixel colors are simply translated into the closest available color from the palette, no dithering will occur (Figure 2). However, typically this approach will result in flat areas (contours) and a loss of detail, and may produce patches of color that are significantly different from the original. Shaded or gradient areas may appear as color bands, which may be distracting. The application of dithering can help to minimize such visual artifacts, and usually results in a better representation of the original (Figure 3). Dithering helps to reduce color banding and flatness.

One of the problems associated with using a fixed color palette is that many of the needed colors may not be available in the palette, and many of the available colors may not be needed; a fixed palette containing mostly shades of green would not be well-suited for images that do not contain many shades of green, for instance. The use of an optimized color palette can be of benefit in such cases. An optimized color palette is one in which the available colors are chosen based on how frequently they are used in the original source image. If the image is reduced based on an optimized palette the result is often much closer to the original (Figure 4).

The number of colors available in the palette is also a contributing factor. If, for example, the palette is limited to only 16 colors then the resulting image could suffer from additional loss of detail, resulting in even more pronounced problems with flatness and color banding (Figure 5). Once again, dithering can help to minimize such artifacts (Figure 6).

Example below:

Images for kids

See also

Kids robot.svg In Spanish: Tramado para niños

kids search engine
Dither Facts for Kids. Kiddle Encyclopedia.