

10Ordered
Bayer 4×4 Dithering
Bayer 4×4 is the classic ordered dither: a 4×4 threshold matrix, from Bryce Bayer’s 1973 method, tiled across the image. It renders 17 gray levels as a regular cross-hatch, the texture of early computer graphics and retro games, and it’s fast, predictable and perfectly stable in animation.
- Author
- Bryce Bayer
- Year
- 1973
- Complexity
- low
How Bayer 4×4 dithering works
The 4×4 matrix holds the ranks 0 to 15, built by nesting the 2×2 pattern inside itself. Each pixel is compared with the threshold at its position in the tile: brighter pixels turn white, darker ones black. Nothing is carried between pixels.
Because each level lights the pixel farthest from those already lit, every gray is spread as evenly as the grid allows, which produces the characteristic cross-hatch. Sixteen thresholds give 17 levels: enough for gradients that look smooth from a distance, few enough that the pattern stays part of the look.
| 0 | 8 | 2 | 10 |
| 12 | 4 | 14 | 6 |
| 3 | 11 | 1 | 9 |
| 15 | 7 | 13 | 5 |
- A 4×4 matrix of 16 ranks is tiled across the image; a pixel turns white when its brightness exceeds the threshold at its position.
- That gives 17 distinct gray levels, each reproduced by a fixed dot pattern.
M = 4×4 matrix of ranks 0…15
for each pixel (x, y):
t = (M[y mod 4][x mod 4] + 0.5) / 16 * 255
pixel = gray < t ? black : white
# with a palette, t shifts the color before nearest_colorWhen to use it (and when not to)
- Best for: retro game and demoscene looks, UI graphics and animated GIFs.
- Works well with: small palettes like Game Boy, PICO-8 or NES.
- Watch out for: the grid is visible on photos, and it can beat into moiré when the result is resized by a fraction instead of a whole multiple.
- In animation: Very stable. Each pixel’s threshold depends only on its position, so areas that don’t move stay identical from frame to frame, with no shimmer. The animated sample on the home page uses Bayer 4×4 with PICO-8.
Bayer 4×4 vs other algorithms
The same terminal in 1-bit, center crop at actual size.

Bayer 4×4 
Bayer 2×2 
Bayer 8×8 
Blue Noise
| Algorithm | Method | Animation | Look |
|---|---|---|---|
| Bayer 4×4 | 4×4 threshold matrix | Stable | Classic cross-hatch, stable |
| Bayer 2×2 | 2×2 threshold matrix | Stable | Chunkier, 5 levels |
| Bayer 8×8 | 8×8 threshold matrix | Stable | Finer, 65 levels |
| Blue Noise | 64×64 threshold matrix | Stable | No grid, fine grain, also stable |
Try Bayer 4×4 on your image
Open the editor with Bayer 4×4 already selected, drop in a photo or an animated GIF, choose the processing scale for the dot size, pick a palette and export the result. Free, no account, no watermark, and your image never leaves your device.
Open Bayer 4×4 in the editorBayer 4×4 FAQ
Why is Bayer dithering used for games and GIFs?
It’s cheap, every pixel can be computed independently, and the pattern is fixed to the pixel grid, so moving sprites and animated frames don’t shimmer. The regular texture also compresses well.
Why does my dithered image show moiré when resized?
The pattern repeats every 4 pixels, so scaling by a fraction makes it beat against the new pixel grid. PixelSynth enlarges the view and the export nearest-neighbor by whole multiples, which keeps it crisp; resize by whole multiples elsewhere too.