RandomNoiseDitherer Class

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.

Definition

Namespace: KGySoft.Drawing.Imaging
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 8.0.0-preview.1
C#
public sealed class RandomNoiseDitherer : IDitherer
Inheritance
Object    RandomNoiseDitherer
Implements
IDitherer

Remarks

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

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 image
Quantized 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

Constructors

RandomNoiseDitherer(AutoStrengthMode, NullableInt32) Initializes a new instance of the RandomNoiseDitherer class with a specific auto strength strategy.
RandomNoiseDitherer(Single, NullableInt32) Initializes a new instance of the RandomNoiseDitherer class.

Extension Methods

InitializeAsync Gets an IDitheringSession instance potentially asynchronously that can be used to dither the result of the specified IQuantizingSession applied to the specified source. If ditherer is a known ditherer that can be evaluated quickly, then this method might be executed synchronously.
This method is available in.NET Framework 4.0 and above.
(Defined by DithererExtensions)

See Also