![]()
Color reductionAForge.NET framework provides set of image processing routines to perform color reduction Below is the list of implemented color reduction routines and the result of Source image ColorImageQuantizer and // 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 );
Color dithering // create dithering routine (use default color table) SierraColorDithering dithering = new SierraColorDithering( ); // apply the dithering routine Bitmap newImage = dithering.Apply( image ); // ... or ... // create color image quantization routine ColorImageQuantizer ciq = new ColorImageQuantizer( new MedianCutQuantizer( ) ); // create 16 colors table Color[] colorTable = ciq.CalculatePalette( image, 16 ); // create dithering routine FloydSteinbergColorDithering dithering = new FloydSteinbergColorDithering( ); dithering.ColorTable = colorTable; // apply the dithering routine Bitmap newImage = dithering.Apply( image ); Below are the images, which could be obtained by color dithering Ordered color dithering
|
|||||||