public RandomNoiseDitherer(
float strength = 0f,
int? seed = null
)
Public Sub New (
Optional strength As Single = 0F,
Optional seed As Integer? = Nothing
)
public:
RandomNoiseDitherer(
float strength = 0f,
Nullable<int> seed = nullptr
)
new :
?strength : float32 *
?seed : Nullable<int>
(* Defaults:
let _strength = defaultArg strength 0f
let _seed = defaultArg seed null
*)
-> RandomNoiseDitherer
public static IReadWriteBitmapData ToDitheredRandomNoise(IReadWriteBitmapData source, IQuantizer quantizer)
{
IDitherer ditherer = new RandomNoiseDitherer();
// 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. |