Color quantization tools.

Namespace:  AForge.Imaging.ColorReduction
Assembly:  AForge.Imaging (in AForge.Imaging.dll) Version: (


public class ColorImageQuantizer


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 colors in the specified image
Bitmap newImage = ciq.ReduceColors( image, 16 );

Initial image:

Result image:

Inheritance Hierarchy


See Also