Color quantization tools.

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

Syntax

C#
public class ColorImageQuantizer

Remarks

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:

CopyC#
// 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

System..::.Object
  AForge.Imaging.ColorReduction..::.ColorImageQuantizer

See Also