Tip
See the Remarks section of the OrderedDitherer class for more details and examples.
public static OrderedDitherer Bayer2x2 { get; }
Public Shared ReadOnly Property Bayer2x2 As OrderedDitherer
Get
public:
static property OrderedDitherer^ Bayer2x2 {
OrderedDitherer^ get ();
}
static member Bayer2x2 : OrderedDitherer with get
public static IReadWriteBitmapData ToDitheredBayer2x2(IReadWriteBitmapData source, IQuantizer quantizer)
{
IDitherer ditherer = OrderedDitherer.Bayer2x2;
// 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 |
---|---|
|
|
|
|