Table of Contents

Method Quantize

Namespace
PaintDotNet
Assembly
PaintDotNet.Data.dll

Quantize(Surface, int, int, bool, ProgressEventHandler?)

Takes a Surface and quantizes it down to an 8-bit bitmap.

protected Bitmap Quantize(Surface quantizeMe, int ditherLevel, int maxColors, bool enableTransparency, ProgressEventHandler? progressCallback)

Parameters

quantizeMe Surface

The Surface to quantize.

ditherLevel int

How strong should dithering be applied. 0 for no dithering, 8 for full dithering. 7 is generally a good default to use, because 8 is a lot slower and can look bad in some scenarios (but sometimes a lot better).

maxColors int

The maximum number of colors to use. This may range from 2 to 256.

enableTransparency bool

If true, then one color slot will be reserved for transparency. Any color with an alpha value less than 255 will be transparent in the output.

progressCallback ProgressEventHandler

The progress callback delegate.

Returns

Bitmap

An 8-bit Bitmap that is the same size as quantizeMe.