Threshold matrix dithering for halftone and retro effects
Bayer ordered dithering uses a threshold matrix to determine whether each pixel should be light or dark. The matrix values are carefully arranged to produce visually pleasing patterns when tiled across an image.
The Bayer matrix is generated recursively: each larger matrix is built from the previous size using the formula M(2n) = [4M(n), 4M(n)+2; 4M(n)+3, 4M(n)+1]. This creates a pattern that minimizes visual artifacts.
Unlike error diffusion dithering (like Floyd-Steinberg), ordered dithering is highly parallelizable and produces consistent, tile-able patterns. It was commonly used in early computer graphics and video games.