Loading ClickForArt…

Floyd-Steinberg Dithering

Floyd-Steinberg dithering for images and video: true error diffusion with a serpentine scan, any palette of up to 16 colors, and Stucki or Burkes a click away.

The whale and balloon dithered to black and white by error diffusion, a dark whale in a light, finely speckled sky

What is Floyd-Steinberg dithering?

Floyd-Steinberg dithering is an error-diffusion algorithm that Robert W. Floyd and Louis Steinberg published in 1976. It goes through the pixels one at a time, rounds each one to the nearest available color, and passes the rounding error on to neighbors it hasn't reached yet.

The error splits 7/16 to the right, 3/16 below left, 5/16 straight below and 1/16 below right. A 50% gray comes out as a checkerboard. Gradients turn into a fine scatter with no repeating grid.

How to apply Floyd-Steinberg dithering to a picture

Upload an image or video. It opens in 1-bit black and white, with Floyd-Steinberg already chosen under Algorithm. Palette sets the colors the result can use, from two up to sixteen, and Dot size sets how big each dot is.

Diffusion is how much of each error gets passed on; at 0 you just get plain nearest color. Brightness and Contrast shape the tones before dithering. With a color palette, the error is carried separately for red, green and blue.

Algorithm also has Atkinson, Jarvis-Judice-Ninke, Stucki, Sierra, Sierra Lite and Burkes, which spread the error over more or fewer neighbors. If you're after the crisper Macintosh look with cleaner whites, Atkinson Dithering opens straight on the Atkinson kernel.

What does the Serpentine option do?

Serpentine scans every other row from right to left and mirrors the error pattern to match. A plain left-to-right scan pushes error the same way on every row, and that can leave diagonal, worm-like streaks. Switching direction breaks them up, which is why it's on by default.

Settings for a small 1-bit display, a 16-color photo and a softer grain

Small 1-bit display, say a 128 by 64 OLED: resize the picture to the screen's exact size first (there's a resizer on the Image Tools hub), then dither at Dot size 1 with Contrast around 0.2. Every screen pixel gets its own dot. The contrast pulls the subject away from its background, which helps when so few pixels have to carry it.

16-color photo: the C64 preset pairs the Commodore palette with Stucki at Dot size 4, and the PICO-8 preset pairs that palette with Sierra at Dot size 3. Both kernels hand the error to ten or twelve neighbors over three rows. That's a wider area than Floyd-Steinberg's four, and it smooths gradients in a busy palette.

Softer grain: the Soft preset uses Sierra Lite with Diffusion at 0.6. Passing on 60% of each error lets near-flat areas settle on one color instead of speckling, while bigger errors still get dithered. The cost is some faint banding in slow gradients like a sky.

Why do the dots shimmer when I dither a video?

Each pixel's color depends on the errors of every pixel scanned before it, so every frame gets dithered from scratch on the CPU. A tiny change near the top of a frame, even sensor noise, ripples down through all the rows below it, and the dots rearrange from one frame to the next.

For a clip that should hold still, Blue Noise Dithering gives a similar even scatter from a fixed mask, so areas that don't change keep their dots. Lowering Diffusion calms the shimmer a bit as well, since smaller errors don't travel as far.

Saving a Floyd-Steinberg dither

PNG is the format for stills. At Dot size 1 the scatter is all single pixels, and JPG compression turns that into gray mush.

A Floyd-Steinberg GIF comes out big, because its scatter never repeats and GIF compression relies on repeats. The same frame in Bayer 4x4 can be a third the size. For a loop, raise Dot size to 3 or more and keep it short. For anything longer, go with MP4.

Further reading