ErrorDiffusionDithererAtkinson Property

Gets an ErrorDiffusionDitherer instance using the filter used by the Apple programmer Bill Atkinson. Uses a 4x3 matrix of only 6 effective values, and propagates only the 75% of the quantization error, which may cause total loss of details of light and dark areas (result may seem under- or overexposed) whereas midtones have higher contrast and preserve details better.

See the online help for an example with images.

Definition

Namespace: KGySoft.Drawing.Imaging
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 9.1.1
C#
public static ErrorDiffusionDitherer Atkinson { get; }

Property Value

ErrorDiffusionDitherer

Examples

The following example demonstrates how to use the ditherer returned by this property:
C#
public static IReadWriteBitmapData ToDitheredAtkinson(IReadWriteBitmapData source, IQuantizer quantizer)
{
    IDitherer ditherer = ErrorDiffusionDitherer.Atkinson;

    // a.) this solution returns a new bitmap data and does not change the original one:
    return source.Clone(quantizer.PixelFormatHint, quantizer, ditherer);

    // b.) alternatively, you can perform the dithering directly on the source bitmap data:
    source.Dither(quantizer, ditherer);
    return source;
}

The example above may produce the following results:

Original image
Quantized and dithered image

Color hues with alpha gradient
Color hues with alpha gradient

Grayscale color shades with different bit depths
Grayscale color shades

Grayscale color shades with black and white palette using Atkinson dithering
Quantizing with black and white palette

See Also