ImageGear for C and C++ on Linux v20.0 - Updated
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Image Processing Functions > IG_IP_color_promote

This function promotes an image to the common pixel formats of 4-bit Indexed, 8-bit Indexed, 24-bit RGB, or 32-bit CMYK.


Copy Code
   HIGEAR hIGear,
   AT_MODE nPromoteTo


Name Type Description
hIGear HIGEAR HIGEAR handle of image.
nPromoteTo AT_MODE Specifies the depth to which to promote. See enumIGPromotionModes for possible values.

Return Value:

Returns 0 if successful. Otherwise, returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.

For Indexed images, bit depth should be no less than the depth specified by the nPromoteTo parameter.


Copy Code
HIGEAR hIGear;            // HIGEAR handle of the image
AT_ERRCOUNT nErrcount;    // Count of errs on stack upon ret from func

// Load image file "picture.tif", 1 bpp, from working directory
nErrcount = IG_load_file("picture.tif", &hIGear);
if(nErrcount == 0)
    // Promote to RGB 24
    nErrcount = IG_IP_color_promote(hIGear, IG_PROMOTE_TO_24);
    // ...
    // Destroy the image


This function is only kept for backward compatibility reasons. Please use IG_image_colorspace_convert and IG_image_channel_depths_change instead.

Is this page helpful?
Yes No
Thanks for your feedback.