ImageGear Professional DLL v17.1 for Windows Accusoft
IG_IP_color_reduce_median_cut
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_median_cut

Glossary Item Box

This function reduces an image by dividing it into nMaxColors equal-sized squares.

Declaration:

  Copy Code
AT_ERRCOUNT ACCUAPIIG_IP_color_reduce_median_cut ( 
        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 The maximum number of colors (that is, maximum number of unique pixel values) you want in the resulting image. Must be 16 to 256.

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 median cut algorithm */
IG_IP_color_reduce_median_cut ( hIGear, FALSE, 64 );

Remarks:

The colors of the pixels in each square will be averaged to produce a resulting color. The resulting image will contain only these colors.

See also section in entitled Color Reduction.
©2012. Accusoft Corporation. All Rights Reserved.