RandomNoiseDitherer Class

KGy SOFT Drawing Libraries Help
Provides an IDitherer implementation for random noise dithering. This class applies a random white noise to the result. For other noise-like ditherers see the OrderedDitherer.BlueNoise property and the InterleavedGradientNoiseDitherer class.
See the Remarks section for details and some examples.
Inheritance Hierarchy

SystemObject
  KGySoft.Drawing.ImagingRandomNoiseDitherer

Namespace:  KGySoft.Drawing.Imaging
Assembly:  KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 5.0.0
Syntax

public sealed class RandomNoiseDitherer : IDitherer

The RandomNoiseDitherer type exposes the following members.

Constructors

  NameDescription
Public methodCode exampleRandomNoiseDitherer
Initializes a new instance of the RandomNoiseDitherer class.
See the Examples section for some examples.
Top
Remarks

The RandomNoiseDitherer generates some random white noise to the quantized source.

Tip Tip
There are also a couple of ditherers with non-random noise-like patterns in this library. See also the OrderedDitherer.BlueNoise property and the InterleavedGradientNoiseDitherer class.

To get always the same result for the same source image and quantizer you can specify a seed when initializing a RandomNoiseDitherer instance. Please note though that specifying a seed prevents parallel processing, which makes performance worse on multi-core systems.

The following table demonstrates the effect of the dithering:

Original imageQuantized image

Color hues with alpha gradient
Color hues with alpha gradient

Color hues with system default 8 BPP palette and silver background
Quantizing with system default 8 BPP palette, no dithering

Color hues with system default 8 BPP palette, using silver background and random noise dithering
Quantizing with system default 8 BPP palette and random noise dithering

Grayscale color shades with different bit depths
Grayscale color shades

Grayscale color shades with black and white palette
Quantizing with black and white palette, no dithering

Grayscale color shades with black and white palette using random noise dithering
Quantizing with black and white palette and random noise dithering

See Also

Reference