Click or drag to resize
Accord.NET (logo)

ColorImageQuantizerCalculatePalette Method (UnmanagedImage, Int32)

Calculate reduced color palette for the specified image.

Namespace:  Accord.Imaging.ColorReduction
Assembly:  Accord.Imaging (in Accord.Imaging.dll) Version: 3.8.0
Syntax
public Color[] CalculatePalette(
	UnmanagedImage image,
	int paletteSize
)
Request Example View Source

Parameters

image
Type: Accord.ImagingUnmanagedImage
Image to calculate palette for.
paletteSize
Type: SystemInt32
Palette size to calculate.

Return Value

Type: Color
Return reduced color palette for the specified image.
Exceptions
ExceptionCondition
UnsupportedImageFormatExceptionUnsupported format of the source image - it must 24 or 32 bpp color image.
Remarks

The method processes the specified image and feeds color value of each pixel to the specified color quantization algorithm. Finally it returns color palette built by that algorithm.

See Also