I have PNG files and they all have RGBA format. The difference is that some of them are RGBA8888 and some of them are RGBA4444. After some digging, it seems that if pixel format in the PNG is RGBA4444, libpng automatically converts it to RGBA8888. The manual says that if the pixel format is RGBA, the depth will only be 8 bits.
PNG_COLOR_TYPE_GRAY
(bit depths 1, 2, 4, 8, 16)
PNG_COLOR_TYPE_GRAY_ALPHA
(bit depths 8, 16)
PNG_COLOR_TYPE_PALETTE
(bit depths 1, 2, 4, 8)
PNG_COLOR_TYPE_RGB
(bit_depths 8, 16)
PNG_COLOR_TYPE_RGB_ALPHA
(bit_depths 8, 16)
Is there a way to retrieve the original bit depth that is defined in the file? I need to be able to tell which image has which channel depth so that I can load them using different format into OpenGL.