Dithering in Digital Imaging: Simulating Color Depth on Limited Palettes
Dithering is a technique to simulate a broader color palette on a limited-color display by strategically arranging available colors in patterns that the eye blends.
How It Works
When reducing an image from millions of colors (24-bit) to 256 (8-bit) or fewer, dithering distributes quantization error to neighboring pixels, creating the illusion of intermediate shades.
Common Algorithms
- Floyd–Steinberg (Error Diffusion): Propagates error to unprocessed neighbors. Smooth, natural gradients. Standard for photos.
- Ordered (Bayer) Dithering: Uses a fixed threshold matrix. Regular patterns; good for graphics, real-time rendering.
- Random Dithering: Adds white noise. Grainy; rarely used alone.
- Atkinson / Jarvis-Judice-Ninke / Stucki: Variants of error diffusion with different kernels.
Applications
- Image Compression: GIF, PNG-8, WebP lossy use dithering for transparency/gradients.
- Color Quantization: Reducing palette for indexed-color formats.
- Print Halftoning: Newspapers, laser printers simulate grayscale with dot patterns.
- Retro Gaming / Demoscene: Artistic dithering on 16/256-color hardware.
- Audio Dithering: Low-level noise added before bit-depth reduction (e.g., 24-bit → 16-bit) to mask quantization distortion.
Modern displays (10-bit+, HDR) reduce the need for dithering, but it remains essential for web graphics, printing, and legacy support.