ImageGear Professional DLL v17.1 for Windows Accusoft
IG_IP_color_reduce_popularity
Send Feedback  
ImageGear Professional DLL v17.1 for Windows > API Reference Guide > Core Component API Reference > Core Component Functions Reference > Image Processing Effects Functions > IG_IP_color_reduce_popularity

Glossary Item Box

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.
©2012. Accusoft Corporation. All Rights Reserved.