ClickForArt

Dithering

Dithering scatters a few colors in a fine pattern so they pass for many. Where the word comes from, how error diffusion works, and where you still see it today.

What is dithering?

Dithering is the trick of scattering a small set of colors in a fine pattern so the eye blends them into shades the palette doesn't contain. A screen limited to black and white can show a gray sky this way, and a 256-color GIF can pass for a photograph.

It works because vision averages over small areas. Once the dots get small enough, you stop seeing them one by one and see only their mix, the way a checkerboard of black and white squares turns gray when you step back from it.

Where does the word dither come from?

In everyday English, dithering means hesitating. The word grew out of didder, an older verb for trembling, and the shaking sense is the one engineers borrowed.

A story repeated in audio textbooks, usually traced to Ken Pohlmann's Principles of Digital Audio, places it in World War II bombers. Their gear-driven navigation computers were said to work better in the air than on the ground, because the plane's vibration kept the parts from sticking, so engineers added small motors to shake them on purpose. The wartime details are hard to check, but the principle holds: a little deliberate noise smooths out the jumps of a coarse system.

How does dithering work?

Rounding every pixel to its nearest available color throws information away in big steps. Dithering spreads that rounding error around, so a small patch of the result averages out to the brightness of the original.

Ordered dithering compares each pixel with a threshold map tiled across the picture, and the best-known map is the one Bryce Bayer published in 1973. Error diffusion walks through the picture pixel by pixel and hands each pixel's leftover error to neighbors it hasn't reached yet. Robert Floyd and Louis Steinberg described the classic version in 1976: 7/16 of the error goes to the right, and 3/16, 5/16 and 1/16 go to the three pixels below.

Noise came first. Lawrence Roberts at MIT added pseudo-random noise to pictures before coarse quantization in the early 1960s, to hide the contour lines in transmitted images. Plain random noise clumps, though. Robert Ulichney's 1987 book Digital Halftoning made the case for blue noise, a scatter with no low-frequency blotches, and it is still what people aim for when a dither should read as fine, even grain.

Where do you still see dithering?

Audio is the biggest hidden user. When a studio master gets cut down to the 16 bits of a CD, a tiny amount of noise goes in first, so quiet fades sink smoothly into hiss instead of breaking up into harsh distortion.

In pictures, look at old GIFs and early web graphics built on the 216-color web-safe palette, at screenshots from the first Macintosh, and at e-readers, many of which show only 16 grays. 3D games dither too: fading hair, distant objects popping in and some soft shadows are drawn as a dither pattern that a later blur or the next frame hides.

How to dither a picture

Dither Image uses ordered patterns. Its 1-bit Bayer preset gives the classic crosshatch, and switching Pattern to Blue noise on the same photo shows how much calmer an even scatter looks. For the error-diffusion grain, open Floyd-Steinberg Dithering at its defaults and then pull Diffusion down toward 0. The less error the tool passes on, the more the midtones collapse into flat black and white patches, which shows you exactly what the diffused error was holding together. Atkinson Dithering gives the brighter, higher-contrast take used on the original Macintosh.

Try it

Further reading