public InterleavedGradientNoiseDitherer(
float strength = 0f
)
Public Sub New (
Optional strength As Single = 0F
)
public:
InterleavedGradientNoiseDitherer(
float strength = 0f
)
new :
?strength : float32
(* Defaults:
let _strength = defaultArg strength 0f
*)
-> InterleavedGradientNoiseDitherer
public static IReadWriteBitmapData ToDitheredInterleavedGradientNoise(IReadWriteBitmapData source, IQuantizer quantizer)
{
IDitherer ditherer = new InterleavedGradientNoiseDitherer();
// 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 |
---|---|
|
|
|
|
ArgumentOutOfRangeException | strength must be between 0 and 1, inclusive bounds. |