Median cut color quantization algorithm.
Namespace:
AForge.Imaging.ColorReductionAssembly: AForge.Imaging (in AForge.Imaging.dll) Version: 2.2.5.0 (2.2.5.0)
Syntax
C# |
---|
public class MedianCutQuantizer : IColorQuantizer |
Remarks
The class implements median cut color quantization algorithm.
See also ColorImageQuantizer class, which may simplify processing of images.
Sample usage:

// create the color quantization algorithm IColorQuantizer quantizer = new MedianCutQuantizer( ); // process colors (taken from image for example) for ( int i = 0; i < pixelsToProcess; i++ ) { quantizer.AddColor( /* pixel color */ ); } // get palette reduced to 16 colors Color[] palette = quantizer.GetPalette( 16 );