Skip to content
A CRT terminal on a checkered table, dithered with Two-Row Sierra in 1-bitThe same terminal before dithering

06Error diffusion

Two-Row Sierra Dithering

Two-Row Sierra is the reduced version of the Sierra filter that Frankie Sierra published a year after it, in 1990. It drops the third row and spreads each pixel’s error over 7 neighbors on just two rows, so it runs faster while keeping most of the smoothness of the full filter.

Author
Frankie Sierra
Year
1990
Complexity
medium

How Two-Row Sierra dithering works

Each pixel is rounded to the nearest available color and its error is split into 16ths: 4 and 3 go to the next two pixels on the row, and 1, 2, 3, 2, 1 to the five pixels below.

It has the same footprint as Burkes, but its weights fall off more gently: the pixel two steps ahead gets 3/16 instead of Burkes’ 2/16, and the one straight below 3/16 instead of 4/16. The error spreads a little wider along the row, for a softer, more even texture.

Error diffusion weights, as a fraction of 16, by position relative to the current pixel
Current pixel4/163/16
1/162/163/162/161/16
  • The error of the current pixel is spread over 7 neighbors that haven’t been processed yet.
  • All of the error is carried forward.
  • Rows are scanned in alternating directions (serpentine), which avoids diagonal streaks.
Pseudocode
for each row y, top to bottom:
  # odd rows go right to left, mirroring dx
  for each x in the row:
    old = pixel[x][y]
    new = nearest_color(old)
    pixel[x][y] = new
    error = old - new
    pixel[x+1][y  ] += error * 4/16
    pixel[x+2][y  ] += error * 3/16
    pixel[x-2][y+1] += error * 1/16
    pixel[x-1][y+1] += error * 2/16
    pixel[x  ][y+1] += error * 3/16
    pixel[x+1][y+1] += error * 2/16
    pixel[x+2][y+1] += error * 1/16

When to use it (and when not to)

  • Best for: a good middle ground between speed and smoothness on large images.
  • Works well with: 1-bit output and retro palettes like the Game Boy’s four greens.
  • Watch out for: slightly grainier gradients than the three-row Sierra.
  • In animation: Like every error diffusion, it flickers: a small change in one frame moves every later dot. For GIFs, Bayer 8×8 or Blue Noise keep their dots in place.

Two-Row Sierra vs other algorithms

The same terminal in 1-bit, center crop at actual size.

Two-Row Sierra compared with Sierra, Sierra Lite, Burkes
AlgorithmMethodAnimationLook
Two-Row SierraError to 7 neighbors (100% carried)FlickersSoft, even, fast
SierraError to 10 neighbors (100% carried)FlickersSmoother, more work
Sierra LiteError to 3 neighbors (100% carried)FlickersGrainier, fastest
BurkesError to 7 neighbors (100% carried)FlickersSame footprint, crisper

Try Two-Row Sierra on your image

Open the editor with Two-Row Sierra already selected, drop in a photo or an animated GIF, adjust how much error travels with the Error diffusion slider, pick a palette and export the result. Free, no account, no watermark, and your image never leaves your device.

Open Two-Row Sierra in the editor

Two-Row Sierra FAQ

Two-Row Sierra or Burkes?

Both reach the same 7 neighbors. Burkes keeps more of the error close to the current pixel for a crisper look; Two-Row Sierra spreads it more evenly for a softer one.

Can I use Two-Row Sierra with color palettes?

Yes. With a palette matched by color, Two-Row Sierra works on the red, green and blue channels, so it handles any palette, from Game Boy greens to the NES colors. Matched by brightness, it dithers along the palette’s dark-to-light ramp instead.