FilterPictureA PictureEditor.com tool

Dither a photograph down to a small palette

Rendered on your computer, not on a server.

You have a photograph with millions of colours and a palette with two. Dithering is the art of spending the difference on a pattern the eye will average back into the tone you lost.

Drag a photograph in, or click to find onePhotographs dither beautifully. Flat graphics dither into nothing, because there is no error to diffuse.

Nothing to hand right now?

Step 1 of 4 — Open

Bring in a picture and you'll see six effects on it at once. Pick the one that looks right, then push it further.

Two families that fail in opposite ways

Every dither answers the same question — this pixel is not in my palette, so what do I do with the difference? — and there are only two honest answers. Push it onto the neighbours you have not reached yet, or decide in advance, from a fixed table, which way each position in the grid should round.

Error diffusion takes the first answer. It is why the average brightness of a diffused picture is exactly right: nothing is discarded, only moved. The cost is that the pattern depends on the whole history of the scan, so it is irregular, unrepeatable, and on a long flat gradient the errors can line up and march across the sky as a visible diagonal grain.

Ordered dithering takes the second. A Bayer matrix tiles across the picture and every pixel is compared against its own cell of that tile, so the pattern is perfectly regular, repeats forever, and carries nothing between pixels — which means it can never produce the marching artefact and can never be mistaken for anything but a grid. That regularity is a defect on a photograph and the entire point on anything that wants to look like an old screen.

The six methods, and what each is for
MethodFamilyReach for it when
Floyd–SteinbergDiffusionYou want the standard, and you want it right
AtkinsonDiffusionYou want contrast and clean paper more than accuracy
SierraDiffusionFloyd is too grainy and you want a smoother spread
Bayer 2×2OrderedYou want the pattern to be the subject
Bayer 4×4OrderedA middle ground that still reads as a screen
Bayer 8×8OrderedThe finest ordered grain, closest to a diffusion look

The controls, in the order they matter

Palette size
One bit means two entries, which with grey levels on is black and white and nothing else. Four, eight, sixteen and thirty-two give the dither progressively less work to do, and the pattern correspondingly less to say. Most of the character of a dither lives at the small end.
Grey levels only
On, the palette is an even ramp from black to white. Off, it is chosen from the colours your own photograph is made of, by repeatedly splitting the colour cloud along its widest axis.
Pattern scale, 1 to 8
The dither is computed on a picture this many times smaller and enlarged back with no smoothing. It decides how large a single dot is, which is the difference between a texture you have to look for and a pattern that is the first thing you see.
Ground colour
What transparency is composited onto before quantising, for the same reason a halftone needs paper: a pixel reduced to one of two states has no state that means see-through.

Why the scan runs in a serpentine

A diffusion kernel pushes error to the right and downwards. Run every row left-to-right and that push always goes the same way, so the errors accumulate a direction and lay down diagonal worms wherever the picture is almost flat — a sky is the classic place to see them.

Alternating the direction row by row costs nothing, stays completely deterministic, and breaks the accumulation, because each row pushes its error the opposite way from the one above it. Every diffusion method here scans that way. It is the single cheapest improvement available to a dither and it is why the skies on this site do not worm the way an unmodified textbook implementation does.

Getting a one-bit picture that reads

A one-bit dither has exactly two values to work with and lives or dies on the contrast of what it was given. A photograph whose interesting parts all sit in the middle of the tonal range will dither into an even grey fuzz, because every cell is asking for roughly half ink and getting a checkerboard. Pictures with genuine darks and genuine lights — a backlit subject, a hard shadow, a bright sky against a silhouette — come through with structure intact.

If a picture is fighting you, raise the pattern scale before you change the method. A dither at scale 3 is making decisions about nine times fewer cells, each of which covers nine times more of the subject, and coarse decisions on a soft photograph are far more legible than fine ones.

Questions about the pattern

Which method should I pick if I only want one?
Floyd–Steinberg, at a palette of two with grey levels on. It is the default for a reason: it keeps the average exactly right, its pattern is irregular enough not to read as a grid, and it is the one most people picture when they say the word dither. Everything else on the list is a deliberate departure from it.
Why does Atkinson blow out my highlights?
Because it only passes on three quarters of each pixel's error and quietly loses the rest. That is technically a defect and it is exactly why the result looks the way it does — contrast survives instead of being averaged away, pale areas run clean to paper rather than picking up a scatter of dark pixels, and the picture reads as an early Macintosh screen rather than as a photograph. If you want the highlights back, Sierra carries all of the error and holds them.
What is the pattern scale for? It is not a quality setting.
It decides how big the dither reads, which is a design decision rather than a performance one. At 1, one dot is one pixel — computed at full resolution and viewed at any normal size, that is a fine grey texture rather than a visible pattern. At 4, the dither is computed on a picture four times smaller and enlarged back with no smoothing at all, so each dot is a crisp 4-pixel square and the pattern is unmistakable. Pick it by how large the finished picture will be seen, not by how big the file is.
Where do the colours come from when I turn grey levels off?
From your photograph. The lab splits the colour cloud of your own picture along its widest axis, over and over, and takes the mean of each resulting box — so a palette of eight chosen from a sunset is eight colours that are actually in that sunset. A generic palette of eight would have to include colours the picture does not contain and omit ones it is made of, which is why a photograph quantised to a fixed web palette goes muddy in a way this does not.

Where to go next