Image Processing
Floyd-Steinberg vs Atkinson vs Bayer: Dithering Algorithms Compared
Dithering is the technique of simulating colors or shades that aren't available in a limited palette by arranging available colors in patterns. It's fundamental to retro computing aesthetics, pixel art, and modern creative effects. But which algorithm should you use?
What is Dithering?
When you reduce an image from millions of colors to just a few (or even two), you lose gradients and subtle shading. Dithering solves this by strategically placing pixels of different colors next to each other so that, from a distance, the eye perceives intermediate shades. Think of newspaper photos printed with just black ink dots of varying sizes.
Error Diffusion Algorithms
Error diffusion algorithms work by processing pixels sequentially. When a pixel is quantized (rounded to the nearest available color), the "error" (difference between the original and quantized color) is distributed to neighboring pixels that haven't been processed yet.
Floyd-Steinberg (1976)
The most widely used dithering algorithm. It distributes the error to 4 neighboring pixels with specific weights: 7/16 right, 3/16 bottom-left, 5/16 bottom, 1/16 bottom-right.
- Strengths: Excellent for photographs. Produces smooth, natural-looking gradients. Widely implemented.
- Weaknesses: Can produce "worm" artifacts in some images. Processing is sequential (not parallelizable).
- Best for: General purpose dithering, photographic content, when quality matters most.
Atkinson (1984)
Created by Bill Atkinson for the Apple Macintosh. It distributes only 6/8 of the error (not all of it), which preserves more contrast and creates a distinctive high-contrast look.
- Strengths: Higher contrast than Floyd-Steinberg. Iconic retro Mac aesthetic. Better for text and line art.
- Weaknesses: Loses more detail in shadows and highlights. Not ideal for smooth gradients.
- Best for: Retro Mac aesthetics, high-contrast images, images with clear subjects.
Ordered Dithering
Bayer Matrix (Ordered)
Unlike error diffusion, Bayer dithering uses a fixed threshold matrix. Each pixel is compared against a threshold from a repeating pattern (2x2, 4x4, 8x8, or 16x16). This produces a structured, grid-like pattern.
- Strengths: Parallelizable (GPU-friendly). Consistent pattern. No error propagation artifacts.
- Weaknesses: Visible grid pattern. Less natural-looking than error diffusion.
- Best for: Game graphics, pixel art, when you want a structured retro look.
Other Notable Algorithms
Jarvis-Judice-Ninke: Distributes error to 12 neighbors (3 rows) for smoother results than Floyd-Steinberg, but slower. Great for print.
Stucki: Similar to Jarvis but with a different error distribution pattern. Often produces the smoothest results of all error diffusion methods.
Sierra: A family of algorithms (Sierra, Two-Row Sierra, Sierra Lite) that balance quality and speed. Sierra Lite is a good fast alternative to Floyd-Steinberg.
Quick Comparison
Try It Yourself
Want to experiment with these algorithms? Our free Dithering Tool supports Floyd-Steinberg, Atkinson, Bayer, Jarvis, Stucki, and Sierra. Upload any image and compare results side by side, all in your browser with no upload required.