Class ColorQuantizer
Translates colors in an image into a Palette of up to MaxColors colors (typically 256).
public class ColorQuantizer
- Inheritance
-
ColorQuantizer
- Inherited Members
Properties
- DistanceAlgorithm
Gets or sets the algorithm used to map novel colors into existing palette colors (closest match). Defaults to EuclideanColorDistance
- MaxColors
Gets or sets the maximum number of colors to put into the Palette. Defaults to 256 (the maximum for sixel images).
- Palette
Gets the current colors in the palette based on the last call to BuildPalette(Color[,]).
- PaletteBuildingAlgorithm
Gets or sets the algorithm used to build the Palette.
Methods
- BuildPalette(Color[,])
Builds a Palette of colors that most represent the colors used in
pixels
image. This is based on the currently configured PaletteBuildingAlgorithm.
- GetNearestColor(Color)
Returns the closest color in Palette that matches
toTranslate
based on the color comparison algorithm defined by DistanceAlgorithm