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
SurfaceThe Surface to quantize.
ditherLevel
intHow 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
intThe maximum number of colors to use. This may range from 2 to 256.
enableTransparency
boolIf 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
ProgressEventHandlerThe progress callback delegate.
Returns
- Bitmap
An 8-bit Bitmap that is the same size as quantizeMe.