Reputation: 3520
What is the bit-format of a 16-bit grayscale TIFF? I read that only 10 bits actually contain intensity data--is this true? When I try to open a 16-bit TIFF in Matlab using imshow(), the image is totally black, but the same image reduced to 8-bits displays fine.
Upvotes: 6
Views: 11760
Reputation: 49179
If a TIFF creator is writing a well-behaved TIFF, each channel should be normalized to the full dynamic range of that channel. In other words, 16 bits per channel should range from 0-65535, 8 bits per channel should range from 0-255.
While the number of bits used could be encoded into a tag, there are no baseline tags that encode this. This means that if a 10 bit device doesn't normalize to 16 bits, there is no way for a baseline reader to understand the intent of the image.
As a side note, there are other image file formats (Dicom is one) which provide a way to express how many bits per channel are significant.
Upvotes: 5
Reputation: 74930
How many bits are used depends a lot on the camera that took the picture. A 14-bit camera will use 14 of 16 bits, a 10-bit camera will use 10.
If you display the image by calling imshow(img)
, all will be black if the full dynamic range of the image wasn't used, since imshow
will scale to the dynamic range (i.e. 0 to 2^16-1). If you call imshow(img,[])
instead, which scales the image to min/max, the image displays nicely.
Upvotes: 6