ImageGear for C and C++ on Linux v20.0 - Updated
API Reference Guide > Core Component API Reference > Core Component Functions Reference > DIB Functions > IG_DIB_bit_depth_get

This function returns the bit depth of an image, which is the sum of the channel bit depths.


Copy Code
AT_INT ACCUAPI IG_DIB_bit_depth_get(


Name Type Description
hDIB HIGDIBINFO DIB info handle.

Return Value:

Returns image bit depth.

Supported Raster Image Formats:

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


Copy Code
AT_ERRCOUNT nErrcount;  /* Number of errors on stack */
HIGDIBINFO hDIBInfo;    /* DIB info handle */
HIGEAR hImage;          /* HIGEAR handle of image */
AT_INT imageDepth;      /* Returned bit depth of image */
nErrcount = IG_image_DIB_info_get(hImage, &hDIBInfo);
imageDepth = IG_DIB_bit_depth_get(hDIBInfo);


For example, if the image is a simple 24-bit RGB image, this function will return 24. If it's a 24-bit RGB image with an 8-bit alpha channel, this function will return 32.

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