Dithering
/ˈdɪðərɪŋ/ · noun · image processing
Dithering mixes dots of the few colors an image is allowed to use so that, from a distance, they blend into shades the palette doesn't have.
In more detail
When an image is reduced to a small palette, smooth gradients turn into hard bands of color. Dithering breaks up those bands by placing pixels of neighboring palette colors next to each other. Your eye averages them, so a pattern of black and white dots reads as gray.
It is used in GIFs, in printing, in retro and pixel art, and on screens that can show only a few colors, such as e-paper displays.
Error diffusion and ordered dithering
Error diffusion, such as the Floyd-Steinberg method, picks the nearest palette color for each pixel and passes the leftover difference on to the pixels that haven't been processed yet. The result looks smooth and organic, a bit like film grain.
Ordered dithering adds a fixed, repeating threshold pattern, usually a Bayer matrix, before choosing each color. It produces the regular cross-hatch texture of early consoles and computer games, and it stays stable when an animation changes from frame to frame.
When to turn dithering off
Flat artwork such as logos, icons, screenshots and hand-made pixel art usually looks cleaner without dithering, because its areas of solid color already fit the palette. Dithered noise also compresses worse in PNG and GIF, so the file can get larger.
Photos and gradients are where dithering helps most. Compare both versions at the size people will actually see.
Key points
- Dithering simulates extra colors with patterns of palette colors.
- Floyd-Steinberg looks smooth; ordered dithering gives a regular retro pattern.
- Skip it for flat graphics, where it only adds noise and file size.