DitheringMode Enum

Selects how colors are dithered when they are reduced to a palette, by ImageProcessingExtensions.Quantize and by the encoders that reduce colors (QuantizeOptions.Dithering).

public enum DitheringMode

Remarks

Error diffusion carries the difference between the color of a pixel and the palette color it gets to the pixels to its right and below, with the weights of the named kernel, left to right on every row from the top row down: the output is the same whatever the row order of the file. Ordered dithering (the Bayer matrices) adds a fixed pattern to the colors before they are mapped, so every pixel is mapped independently of the others.

Only opaque pixels are dithered by error diffusion: a translucent pixel maps to its nearest palette entry, and transparent pixels neither receive nor spread error. Ordered dithering applies to every pixel that is not fully transparent. A frame whose colors are all in the palette is never dithered.

Fields

NameValueDescription
None0No dithering: each pixel maps to its nearest palette entry. This is the default.
FloydSteinberg1Floyd–Steinberg error diffusion (7, 3, 5, 1 sixteenths).
Atkinson2Atkinson error diffusion: six neighbors get an eighth each, so a quarter of the error is dropped (less noise, more contrast).
Burkes3Burkes error diffusion over two rows (thirty-seconds).
JarvisJudiceNinke4Jarvis, Judice and Ninke error diffusion over three rows (forty-eighths).
Sierra5Sierra error diffusion over three rows (thirty-seconds).
SierraTwoRow6Two-row Sierra error diffusion (sixteenths).
SierraLite7Sierra Lite error diffusion (2, 1, 1 quarters): the fastest kernel after Floyd–Steinberg.
Stucki8Stucki error diffusion over three rows (forty-seconds).
Bayer2x29Ordered dithering with the 2×2 Bayer matrix.
Bayer4x410Ordered dithering with the 4×4 Bayer matrix.
Bayer8x811Ordered dithering with the 8×8 Bayer matrix.