ColorImageQuantizer Class |
Namespace: Accord.Imaging.ColorReduction
The ColorImageQuantizer type exposes the following members.
Name | Description | |
---|---|---|
ColorImageQuantizer |
Initializes a new instance of the ColorImageQuantizer class.
|
Name | Description | |
---|---|---|
Quantizer |
Color quantization algorithm used by this class to build color palettes for the specified images.
| |
UseCaching |
Use color caching during color reduction or not.
|
Name | Description | |
---|---|---|
CalculatePalette(Bitmap, Int32) |
Calculate reduced color palette for the specified image.
| |
CalculatePalette(UnmanagedImage, Int32) |
Calculate reduced color palette for the specified image.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ReduceColors(Bitmap, Color) |
Create an image with reduced number of colors using the specified palette.
| |
ReduceColors(Bitmap, Int32) |
Create an image with reduced number of colors.
| |
ReduceColors(UnmanagedImage, Color) |
Create an image with reduced number of colors using the specified palette.
| |
ReduceColors(UnmanagedImage, Int32) |
Create an image with reduced number of colors.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
HasMethod |
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) | |
IsEqual |
Compares two objects for equality, performing an elementwise
comparison if the elements are vectors or matrices.
(Defined by Matrix.) | |
To(Type) | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) | |
ToT | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) |
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: