Dithering

Dithering trades spatial resolution for grey-level depth. A device with few output levels approximates an intermediate intensity by mixing the available levels over a small region, which the eye averages at normal viewing distance.

  • Each pixel is divided into sub-pixels, each forced to an available level
  • The count of sub-pixels at the higher level encodes the target intensity
  • A fixed dither matrix sets the order in which sub-pixels switch on, spreading them to avoid visible clumps

Used in newspaper halftoning, laser printing, and exporting photos to a small fixed palette such as GIF.

Ordered Dithering

Let v∈[0,1]v \in [0,1] be the target intensity. An n×nn \times n dither matrix DD contains the integers from 00 to n2−1n^2 - 1. Each entry gives the threshold for its sub-pixel.

Tij=Dij+0.5n2qij={1v>Tij0v≤Tij\begin{aligned} T_{ij} &= \frac{D_{ij} + 0.5}{n^2} \\ q_{ij} &= \begin{cases} 1 & v > T_{ij} \\ 0 & v \leq T_{ij} \end{cases} \end{aligned}
Here:
TijT_{ij}
threshold at sub-pixel (i,j)(i,j)
DijD_{ij}
dither matrix entry at sub-pixel (i,j)(i,j)
qijq_{ij}
bi-level output at sub-pixel (i,j)(i,j)
nn
dither matrix order

The 2×22 \times 2 Bayer dither matrix is:

D=[0231]D = \begin{bmatrix} 0 & 2 \\ 3 & 1 \end{bmatrix}

Dithering

Left: Original. Middle: Reduced to 2 levels by a single threshold, which loses most of the tones. Right: Reduced to 2 levels with an 8×88 \times 8 Bayer dither matrix, where the density of white dots recovers the tones.
Generated from a photo by Hannes Röst, CC BY-SA 3.0.

Worked Example

A bi-level device with target intensity v=0.5v = 0.5 across one 2×22 \times 2 block, using the Bayer dither matrix above.

Solution Reveal Hide
  • (0,0)(0,0) has threshold 0.1250.125. Since 0.5>0.1250.5 > 0.125, set to 11.
  • (0,1)(0,1) has threshold 0.6250.625. Since 0.5<0.6250.5 < 0.625, set to 00.
  • (1,0)(1,0) has threshold 0.8750.875. Since 0.5<0.8750.5 < 0.875, set to 00.
  • (1,1)(1,1) has threshold 0.3750.375. Since 0.5>0.3750.5 > 0.375, set to 11.

2 of the 4 sub-pixels are on, so the block averages 0.50.5, matching the target. The on sub-pixels form a checkerboard.

Ordered dithering of a 2x2 block at intensity 0.5 Target Threshold Output > = 0.5 0.125 1 0.5 0.625 0 0.5 0.875 0 0.5 0.375 1
A flat target intensity is compared with the threshold of each cell. A cell turns white where the target is above its threshold and black otherwise. Here 2 of 4 cells are white, so the block averages 0.5.
Written by November 3, 2026 2 min read
Was this helpful?