Skip to content
ToolsNow
Guides All tools

Floyd–Steinberg, Bayer and Atkinson dithering compared

Error diffusion, ordered dithering and halftones solve the same problem in different ways. What each one does to gradients, edges, file size and animation.

Published

Dithering exists because of a gap between what you have and what you can show. You have an image with millions of colours. You can display two, or sixteen. Rounding each pixel to the nearest available colour gives you flat bands and a posterised mess.

Dithering’s insight is that the error — the difference between the colour a pixel wanted and the colour it got — is information, and throwing it away is the mistake. Distribute it instead, and the eye blends the result back into tones that are not there.

Two families, and the difference that matters

Error diffusion processes pixels in order. Each pixel is rounded to the nearest palette colour, and the leftover error is pushed onto neighbours that have not been visited yet, which are therefore nudged in the opposite direction. Sequential by construction: pixel 500 depends on pixel 499.

Ordered dithering adds a value from a small repeating tile to each pixel before rounding. Every pixel is independent of every other, so it parallelises perfectly and can be done in a shader.

That structural difference drives everything else. Error diffusion adapts to the image and produces organic, non-repeating texture. Ordered dithering applies the same pattern regardless of content and produces a visible regular weave.

Floyd–Steinberg

Published by Robert Floyd and Louis Steinberg in 1976, and still the default almost everywhere. The error from each pixel is spread across four neighbours:

        X    7/16
 3/16  5/16  1/16

The weights sum to exactly 1 — all of the error is conserved, none is discarded.

Strengths. The best preservation of gradient detail of any common method. Photographs, skies and skin keep their shape. It adapts to content automatically.

Weaknesses. In large flat areas it can produce faint diagonal streaks often described as “worms”. Because the whole image is one dependency chain, a single changed pixel alters everything after it — which makes it a poor choice for animation, where consecutive frames end up with completely different dither patterns and the result crawls.

Serpentine scanning — alternating left-to-right and right-to-left down the image — reduces the worming noticeably at essentially no cost, and is worth knowing about if you implement this yourself.

Atkinson

Attributed to Bill Atkinson at Apple, and what the original 512 × 342 one-bit Macintosh display used. Six neighbours, an eighth of the error each:

        X    1/8  1/8
 1/8   1/8   1/8
       1/8

Six eighths. A quarter of the error is deliberately thrown away.

That single decision explains the entire look. Error that would have pulled a region back toward the mean simply vanishes, so highlights blow out to white and shadows crush to black, and the mid-tones that survive have far more local contrast. On a portrait it produces the crisp, slightly graphic-novel appearance people recognise instantly from early Mac software.

Use it for line art, logos, high-contrast subjects, and anywhere you want the picture to look confident rather than accurate. Avoid it for images whose subject lives in the extremes — a foggy landscape loses its sky, a dark interior loses its shadow detail.

Bayer (ordered)

Named after Bryce Bayer’s 1973 paper, the same Bayer as the colour filter array in camera sensors. A threshold matrix is generated recursively — the 4 × 4 tile is the one you will see quoted most often:

 0  8  2 10
12  4 14  6
 3 11  1  9
15  7 13  5

Each pixel is offset by the matrix value at its position modulo the tile size, then rounded. The values are arranged so that as a region darkens, the dots fill in as evenly spread as possible at every level.

One implementation detail matters: the offset should be centred on zero, running from −half to +half rather than 0 to full. An uncentred offset brightens or darkens the whole image, which is a surprisingly common bug.

Strengths. Fast, stateless and parallelisable. Because the pattern is fixed, consecutive video or animation frames dither identically, so there is no crawling — this is why ordered dithering is used in real-time rendering. The regular texture also compresses far better than diffusion noise. And for a certain retro aesthetic, the visible crosshatch is the point.

Weaknesses. The pattern is visible, and on a large flat area it reads as a screen door over your image. Larger matrices (8 × 8) give finer tone at the cost of a more obvious grid at close range.

Threshold, for completeness

No diffusion at all: above the midpoint go white, below go black. Maximum contrast, maximum detail loss. It is the right answer for scanned text and line art, where you want clean shapes rather than a stippled approximation of grey — and dithering a page of scanned text actively harms legibility.

Halftones are a different thing entirely

Halftoning is frequently lumped in with dithering and works on a different principle. Dithering chooses between available colours pixel by pixel. A halftone replaces regions with shapes whose area encodes brightness — the technique that lets a printing press reproduce a photograph with one colour of ink, because ink is either present or absent and cannot be grey.

Two consequences follow.

Dot area, not radius, is proportional to darkness. Ink coverage goes as the square of the radius, so radius must go as the square root of darkness. Using darkness directly for the radius makes mid-tones far too dark — the classic naive-halftone mistake, and the reason so many of them look like everything was photographed at dusk.

The screen angle matters. A dot grid at 0° aligns with the image’s own rows and produces strong moiré against any horizontal detail. The printing trade settled on 45° for single-colour work, the angle at which the eye is least sensitive to a regular pattern. Colour separations are set at different angles from one another — traditionally about 15° apart, with yellow, the least visible ink, given the most conspicuous angle — precisely so the four screens do not form a moiré with each other.

Choosing, briefly

SituationMethod
Photograph, one still imageFloyd–Steinberg
Line art, logo, high contrastAtkinson or threshold
Animation or videoBayer — no crawling between frames
Retro game aestheticBayer, visible on purpose
Scanned textThreshold
Print or newsprint lookHalftone at 45°
File size mattersBayer, or no dithering

The palette matters more than the method

One last thing worth saying, because it is easy to spend an hour on the wrong variable. Dithering can only mix the colours you give it. Two well-chosen colours will beat sixteen badly chosen ones, and no amount of switching between diffusion kernels rescues a palette that has nothing near the image’s dominant hues. Get the palette right first; the method is the finishing touch.

Sources and further reading

Last reviewed 31 July 2026.