The class contains methods aimed to simplify work with color quantization algorithms implementing IColorQuantizer interface. Using its methods it is possible to calculate reduced color palette for the specified image or reduce colors to the specified number.
Sample usage:
// instantiate the images' color quantization class ColorImageQuantizer ciq = new ColorImageQuantizer( new MedianCutQuantizer( ) ); // get 16 color palette for a given image Color[] colorTable = ciq.CalculatePalette( image, 16 ); // ... or just reduce color in the specified image Bitmap newImage = ciq.ReduceColors( image, 16 );
Initial image:
Result image: