Skip to content Skip to sidebar Skip to footer

How To Find The Bit Depth Of An Image

I am trying to get the Statistics of image like width, height, bands, min, max, mean, stddev etc., I could find all of these but however i can't find the Bit Depth of an image. i

Solution 1:

"Color depth, also known as bit depth, is either the number of bits used to indicate the color of a single pixel, in a bitmapped image or video frame buffer, or the number of bits used for each color component of a single pixel." [0]

You can check it by checking the data-type. If you are getting a numpy array in python, you can check the data-type with my_array.dtype. You probably get either a uint8 (8 bit/ 1 byte per colour channel) or uint16 (16 bit / 2 bytes per colour channel) in rare cases. But most images are encoded in uint8.

[0] https://en.wikipedia.org/wiki/Color_depth

Post a Comment for "How To Find The Bit Depth Of An Image"