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 DitheringModeRemarks
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
| Name | Value | Description |
|---|---|---|
None | 0 | No dithering: each pixel maps to its nearest palette entry. This is the default. |
FloydSteinberg | 1 | Floyd–Steinberg error diffusion (7, 3, 5, 1 sixteenths). |
Atkinson | 2 | Atkinson error diffusion: six neighbors get an eighth each, so a quarter of the error is dropped (less noise, more contrast). |
Burkes | 3 | Burkes error diffusion over two rows (thirty-seconds). |
JarvisJudiceNinke | 4 | Jarvis, Judice and Ninke error diffusion over three rows (forty-eighths). |
Sierra | 5 | Sierra error diffusion over three rows (thirty-seconds). |
SierraTwoRow | 6 | Two-row Sierra error diffusion (sixteenths). |
SierraLite | 7 | Sierra Lite error diffusion (2, 1, 1 quarters): the fastest kernel after Floyd–Steinberg. |
Stucki | 8 | Stucki error diffusion over three rows (forty-seconds). |
Bayer2x2 | 9 | Ordered dithering with the 2×2 Bayer matrix. |
Bayer4x4 | 10 | Ordered dithering with the 4×4 Bayer matrix. |
Bayer8x8 | 11 | Ordered dithering with the 8×8 Bayer matrix. |