Can both PSNR and Compression ratio be good for the same image?
2 views (last 30 days)
Show older comments
I am using a compression algorithm for a image. Then I am calculating both PSNR and compression ratio of the image. I am getting a high PSNR value. For the same image is it possible to obtain high compression ratio?
0 Comments
Answers (1)
Walter Roberson
on 20 Nov 2015
Yes.
Let the image be 1024 x 768, with the pixel value 42 in every pixel except the bottom row is 43. This can compress considerably, possibly to 5 bytes. But suppose the decompressed version is all 42 everywhere, that the bottom border of 43 was restored incorrectly.
Then for this image, for the MSE calculation the difference would be 0 nearly everywhere but would be 1 for a 1 x 768 strip. The total squared error would then be 1*768 and that would be divided by 1024 * 768 to give an MSE of 1/1024. If you work through the PSNR calculation,
10*log10(255^2/(1/1024))
you will get about 78.2 which is decent. Meanwhile your compression ratio might be 150000 to 1.
If you accept a lower compression ratio then the PSNR can improve by supposing lower and lower imperfections in the re-creation, which would probably take more storage.
Of course if you have a constant image and it is restored perfectly and compresses extremely well because it is constant, then your PSNR is going to be infinite because your MSE would be 0.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!