Dithering

Dithering fakes a full range of tones with only two colors, or a small palette, by arranging dots cleverly. This page explains all 14 dithering algorithms in Bitgrain, the dither factor, palettes, why resolution changes everything, and a set of recipes to start from.

How dithering works in Bitgrain

Imagine you can only print black or white. Rounding every pixel to the nearest of the two gives you harsh, flat blobs. Dithering rounds the same way, but hides the rounding mistakes in a pattern of dots, so from a normal viewing distance your eye blends them back into greys.

Bitgrain's dither effect works on the working grid:

  1. Your adjustments are applied first.
  2. Each cell is measured by its luminance (how bright it looks), or by its full color if you picked a palette.
  3. The algorithm decides, cell by cell, which tone or palette color it becomes.
  4. The result is drawn as a grid of hard-edged 2 x 2 px dots.

Without a palette, a cell is compared against the midpoint and becomes ink or paper. With a palette, it becomes the nearest palette color. What changes between algorithms is how they decide, and that decision is the whole character of the look.

Where to find it

WorkspaceWhereAlgorithm pickerStrength control
Image editorThe dither button on the toolbarTwo groups, "Error Diffusion" and "Ordered"Factor, 10% to 200%, default 100%
Video editorAdd the Dither effectMethod menuIntensity, 0.1 to 2, default 1
StudioBitgrain effects, then DitherMethod menuIntensity, 0 to 4, default 1

The image editor lists methods in lowercase with dashes removed (for example "floyd steinberg", "sierra 2", "bayer 4"). The video editor and Studio use names like "Floyd-Steinberg", "Bayer 4x4" and "JJN". The headings below use the video and Studio names. The image editor starts on Atkinson, while the video editor and Studio start on Floyd-Steinberg.

The dither effect also has a color switch:

WorkspaceControlDefault
Image editorThe colorize toolbar buttonOn
Video editorSource colorOn
StudioColorOff

Dither factor

The factor (called Intensity in video and Studio) scales how much of each cell's rounding error is passed on to its neighbours.

Note: The factor only affects the eight error diffusion methods. Bayer, blue noise, threshold and random ignore it, because they never spread error in the first place.

Error diffusion

Error diffusion methods walk the grid one cell at a time. For each cell they pick the nearest tone, measure the difference (the error), and push fractions of that error onto cells they have not visited yet. Neighbours that received extra darkness are more likely to become ink, so tone is preserved on average.

Bitgrain scans in a serpentine path: left to right on even rows, right to left on odd rows. This avoids the diagonal "rain" that a one-way scan leaves in flat areas.

The algorithms differ in how far the error travels and how it is weighted. Wider kernels (the pattern of neighbours that share the error) give smoother gradients and less visible structure. Smaller ones give crisper, grainier dots.

Floyd-Steinberg

The classic from 1976. The error goes to four neighbours: 7/16 to the right, and 3/16, 5/16 and 1/16 to the three cells below.

Atkinson

Developed for the original Apple Macintosh. Six neighbours each receive 1/8 of the error, which adds up to only 6/8. A quarter of the error is thrown away on purpose.

Sierra

The full three-row Sierra kernel, spreading error across ten neighbours (weights in 32nds).

Sierra 2

The two-row Sierra variant, seven neighbours (weights in 16ths).

Sierra Lite

The smallest kernel in the set: half the error goes right, a quarter to each of two cells below.

Stucki

Twelve neighbours across three rows (weights in 42nds), with more weight near the center than JJN.

Burkes

A simplified Stucki that uses only two rows, seven neighbours (weights in 32nds).

JJN

Jarvis, Judice and Ninke's kernel: twelve neighbours across three rows (weights in 48ths), the widest spread of the group.

Ordered and threshold methods

These methods decide each cell on its own, by comparing it to a threshold. No error is passed around, so there are no streaks and no worms, and one cell never affects another. That makes them stable: move part of the image and the rest does not change. It is also why they hold up well in animation.

In the image editor, these six sit under the "Ordered" heading.

Bayer 2x2

A tiny repeating 2 x 2 threshold pattern, so only five distinct tone levels are possible.

Bayer 4x4

A 4 x 4 pattern giving 17 tone levels.

Bayer 8x8

An 8 x 8 pattern giving 65 tone levels.

Blue noise

A 16 x 16 threshold tile arranged so dots spread evenly with no obvious grid and no clumps.

Threshold

No dithering at all. Every cell is simply ink or paper depending on whether it is darker or lighter than the midpoint. With a palette, each cell just becomes its nearest palette color.

Random

Each cell is compared against a noise threshold, so tone becomes pure static.

Choosing an algorithm

You wantTry
A safe photographic resultFloyd-Steinberg
Punchy black and white with clean highlightsAtkinson
The smoothest possible gradientsJJN or Sierra
Crisp detail for printStucki or Burkes
Retro console graphicsBayer 4x4 with a console palette
A woven, patterned screenBayer 8x8
Natural grain that stays still in videoBlue noise
A stencil or posterThreshold
Noise and gritRandom

Color, colorize and palettes

Dithering has three color behaviours, depending on the color switch and the palette:

  1. No palette, color off. Pure two-tone: ink cells are black, paper cells show the paper color.
  2. No palette, color on. The decision is still made in black and white, but ink cells take the original color of that spot in the photo. You get colored dots on paper, like a screenprint.
  3. Palette chosen. The algorithm works in full color against the palette colors, and error diffusion spreads the color error, so the palette mixes optically into shades it does not contain. Every cell is painted in its palette color, including light ones, so pale palette entries such as pink, cream or yellow show up exactly as chosen.

In the image editor, pick a palette from the palette button. "No palette" turns palettes off. The list shows these palettes:

PaletteColorsPaletteColors
Gameboy DMG4Thermal7
NES56Forest6
C6416Arctic6
Apple II16Vaporwave6
CGA4Neon6
PICO-816Noir6
ZX Spectrum15Vintage6
MSX16Amber CRT6
Risograph8Green CRT6
Gameboy Pocket4Sepia7
Duotone Magenta6Cyanotype7
Sunset6Mono Cream5

Generate from image (the pipette button at the bottom) samples the current output and builds an 8-color palette from it, skipping near-black pixels. It appears in your look as "Aura Gen".

Tip: Palettes with few colors dither most visibly. Error diffusion with a 4-color palette gives the richest texture. Ordered dithering with a 16-color palette gives the cleanest retro look.

A palette is also enforced on the final output of every effect, not just dithering. See palette enforcement.

Why resolution matters

Dithering happens on the working grid, not on your full-size photo. In the image editor the grid is 0.4 x image width x Resolution cells across, and each cell is drawn as a 2 x 2 px dot. The grid is capped at 2,000 cells on the long edge.

For a photo 3,000 px wide:

ResolutionGrid widthWhat you see
25%300 cellsBig, chunky dots. Very graphic, little detail.
100%1,200 cellsBalanced. Dots visible up close, tone reads well.
200%2,000 cells (capped)Fine dots, lots of detail, reads almost like grain.

Every algorithm looks different at each size. Atkinson and Bayer patterns come alive at low resolution, where each dot is visible. JJN and Stucki shine at higher resolution, where their smoothness has room.

When you export, the dither grid is not recalculated. Bitgrain renders the same grid you see and enlarges it with nearest-neighbour scaling, so your export has exactly the dots from the preview, just bigger and still perfectly sharp. That is also why a dither at low Resolution exported at 4x is a crisp pixel-art file rather than a blurry one. See scaling up for export.

Recipes

These use only controls from the image editor. Treat them as starting points.

Classic Mac

  1. Click dither and pick atkinson.
  2. Turn colorize off. Leave palette on "No palette".
  3. In adjust, set Resolution around 60%, Contrast 1.4x, Saturation 0x.

Handheld console

  1. Click dither and pick bayer 4.
  2. Choose the Gameboy DMG palette.
  3. Set Resolution to 25% to 40% so each dot reads as a pixel.

Newspaper photo

  1. Pick stucki or floyd steinberg.
  2. Turn colorize off, set Contrast to 1.3x.
  3. Keep Print finish on in adjust for a paper tone and slight misregistration.

Screenprint in color

  1. Pick floyd steinberg with colorize on.
  2. Raise Saturation to 1.5x and Contrast to 1.3x.
  3. Drop Factor to 70% for flatter, poster-like areas.

Glitchy worms

  1. Pick sierra lite or burkes.
  2. Push Factor to 180% or more.
  3. Try the Vaporwave or Neon palette.

Cyanotype blueprint

  1. Pick blue noise.
  2. Choose the Cyanotype palette.
  3. Set Resolution to 100% and Contrast to 1.5x.

Tip: Save a look you like as a preset so you can reuse it. See presets and recipes.

More documentation