Calculate reduced color palette for the specified image.

Namespace:  AForge.Imaging.ColorReduction
Assembly:  AForge.Imaging (in AForge.Imaging.dll) Version: 2.2.5.0 (2.2.5.0)

Syntax

C#
public Color[] CalculatePalette(
	UnmanagedImage image,
	int paletteSize
)

Parameters

image
Type: AForge.Imaging..::.UnmanagedImage
Image to calculate palette for.
paletteSize
Type: System..::.Int32
Palette size to calculate.

Return Value

Return reduced color palette for the specified 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.

Exceptions

ExceptionCondition
AForge.Imaging..::.UnsupportedImageFormatExceptionUnsupported format of the source image - it must 24 or 32 bpp color image.

See Also