This function reduces a 24-bit image to an 8-bit image while retaining its most popular, or prevalent, colors.
Declaration:
Copy Code | |
---|---|
AT_ERRCOUNT ACCUAPI IG_IP_color_reduce_popularity ( HIGEAR hIGear, BOOL bFastRemap, UINT nMaxColors ); |
Arguments:
hIGear | HIGEAR handle of image. |
bFastRemap | Set = TRUE for reduction algorithm optimized for speed. Set = FALSE for algorithm optimized for quality. |
nMaxColors | Number of colors to which to reduce. |
Return Value:
Returns the number of ImageGear errors that occurred during this function call.
Supported Raster Image Formats:
Indexed RGB – 4, 8 bpp;
Grayscale – 4, 8 bpp;
RGB – 24 bpp.
Sample:
None
Example:
Copy Code | |
---|---|
HIGEAR hIGear; /* HIGEAR handle of image */ /* Reduce to 64 colors using octree algorithm */ IG_IP_color_reduce_popularity ( hIGear, FALSE, 64 ); |
Remarks:
Use nMaxColors to specify the maximum number of colors wanted in the result.
See also the section in entitled Color Reduction. |