Bit Per Pixel
7 views (last 30 days)
Show older comments
Can any body plz. tell me how i calculate bpp(bits per pixel) for a image.
Answers (2)
Walter Roberson
on 16 May 2012
bits per pixel is 8 divided by the compression ratio . For example, if the compression ratio is 5:2 then bits per pixel is 8/(5/2)
0 Comments
Image Analyst
on 16 May 2012
the number you see when you do
class(yourImage);
will tell you how many bits are in your integer image once it's read into MATLAB. It will be probably be 8, but might be 16 (not sure if jpg supports 16 bit images but it might). Not all of those bits may be necessary. In other words, sometimes 10, 12, or 14 bit cameras will load their data into the upper or lower part of a 16 bit word, or you could have some bits that are so noisy that they're basically worthless. Of course it will be less if you use the bytes on disk of the compressed image. But you have to decide what you want to use for the bytes on disk - the actual bytes used, or the bytes in the file, which will include some slack space since data has to be stored as an integer number of disk sectors even if you only needed one byte on a sector. For example, a one byte data file could take up 8192 bytes on disk because it has to take up a whole sector.
0 Comments
See Also
Categories
Find more on Image Segmentation and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!