Median cut color quantization algorithm.

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 coloer */ ); } // get palette reduced to 16 colors Color[] palette = quantizer.GetPalette( 16 );
Inheritance: IColorQuantizer
コード例 #1
0
 public static Bitmap MedianCut(Bitmap bmp, int intensity)
 {
     ColorImageQuantizer ciq = new ColorImageQuantizer(new MedianCutQuantizer());
     IColorQuantizer quantizer = new MedianCutQuantizer();
     Bitmap newImage = ciq.ReduceColors(bmp, intensity);
     return newImage;
 }