Dithering
Dithering is a computer technique used in digital signal processing to reduce quantization error by adding controlled noise to a signal, such as an image or audio file. This creates the perception of more colors or shades than are actually available, and is used to smooth out banding in images or to make audio files sound smoother by preserving low-level details. It is often used when converting a high-color or high-bit-depth signal to a lower-resolution format.
In images
Purpose: To create the appearance of more colors or shades than a display can physically show.
How it works: Adjacent pixels of available colors are arranged to form patterns that trick the eye into perceiving a new color or a smoother shade.
Example: When a grayscale image is converted to black and white, dithering uses a pattern of black and white dots to simulate various shades of gray. This is also how anti-aliasing works, smoothing jagged edges on text and curves.
Methods: Common methods include ordered dithering, which uses a fixed pattern, and error diffusion, which distributes the quantization error to neighboring pixels (e.g., the Floyd-Steinberg filter).
In audio
Purpose: To reduce quantization noise and distortion that occurs when an analog sound is converted to a digital format, especially when reducing the bit depth.
How it works: A small amount of random noise is added to the signal before quantization.
Example: Dithering is applied during audio mastering when converting a higher-bitrate file (like 24-bit) to a lower one (like 16-bit) to minimize the loss of detail and prevent a "choppy" or rough sound.
Benefit: The added noise is perceived as less intrusive than the artifacts caused by quantization alone, resulting in a smoother, higher-fidelity sound.