Assembly: AForge.Imaging (in AForge.Imaging.dll) Version: 184.108.40.206 (220.127.116.11)
- Type: AForge.Imaging..::.UnmanagedImage
Source image to process.
- Type: System..::.Int32
Number of colors to get in the output image, [2, 256].
Return ValueReturns image with reduced number of colors.
The method creates an image, which looks similar to the specified image, but contains reduced number of colors. First, target color palette is calculated using CalculatePalette(UnmanagedImage, Int32) method and then a new image is created, where pixels from the given source image are substituted by best matching colors from calculated color table.
|AForge.Imaging..::.UnsupportedImageFormatException||Unsupported format of the source image - it must 24 or 32 bpp color image.|
|System..::.ArgumentException||Invalid size of the target color palette.|