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

This function gets the number of bits allocated for each pixel channel in an image: 8, 16, or 32.


Copy Code
AT_ERRCOUNT ACCUAPI IG_image_bits_per_channel_get(
        HIGEAR hIGear, 
        AT_INT* lpBitsPerChannel 


Name Type Description
hIGear HIGEAR HIGEAR handle of image.
lpBitsPerChannel AT_INT* Returned number of allocated bits for each pixel channel.

Return Value:

Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.

Supported Raster Image Formats:

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


Copy Code
AT_ERRCOUNT nErrcount;  /* Number of errors on stack */
HIGEAR hImage;          /* Handle of image */
AT_INT nBits;           /* Number of bits per channel */
nErrcount = IG_image_bits_per_channel_get(hImage, &nBits);


This is not the same as the bit depth of a channel. The number of bits used for a pixel channel may be less than the number of bits allocated.
Is this page helpful?
Yes No
Thanks for your feedback.