How to calculate the compression ratio for compressed image?
3 views (last 30 days)
Show older comments
hi,
I am working on image processing project, I need to find the compression ratio of compressed image.
0 Comments
Answers (1)
Image Analyst
on 31 Dec 2013
After you've saved your image onto disk in your compressed format, look at the file size and compare it to the other file which is compressed with a different method or uncompressed:
fileName = 'moon.tif';
fileInfo = imfinfo(fileName)
strInfo = sprintf('\n%s is an %d bit image.\nFile size = %d bytes, and %d columns wide by %d lines tall', ...
fileName, fileInfo.BitsPerSample, fileInfo.FileSize, fileInfo.Width, fileInfo.Height);
fprintf('%s\n', strInfo);
0 Comments
See Also
Categories
Find more on Import, Export, and Conversion in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!