The PSNR does a point-by-point comparison between two images. The histograms capture the entire distribution of intensities as a whole. For example, if you had an image that was:
A = [0 255;
255 0];
... and another that was:
B = [255 0;
0 255];
... and let's say original image was
C = [0 128;
128 0];.
Even though the histograms between A
and B
are the same, the PSNRs are 9.0650
and 2.0344
dB respectively. As such, I wouldn't rely on the histograms themselves as they only capture global information. Look at it locally. You can obviously see one has higher quality than the other. In your histograms, though most of the bins of the histograms look equal, but histograms are not spatially aware. In other words, the spatial relationships of pixels are not captured in histograms, as you have seen with my example I gave above. You could have, say, 15 pixels having intensity 80 for both images, but they could be in completely different locations in each of the images. As such, you could have a completely different looking image in comparison to another, but if you counted the amount of pixels per intensity, as long as the counts per intensity are equal, the histograms will be equal.
You can see that A
and C
are similar in that one is simply the grayer version of the other. However, B
is way off as it has white pixels where there are dark pixels in C
, and dark pixels when there are gray pixels in C
. Though the histograms between A and B are the same, the actual content between them are quite different compared to C
.
I do realize that you need to compare the histograms / probability distributions between both of the images, but this question may have been asked on purpose. Though you can see the distribution of intensities is relatively the same, if you analyze local image patches between the two, you can definitely see that one is a lower quality than the other. To be honest, and recounting from personal experience, you should take PSNR with a grain of salt. Just because one image has a higher PSNR than the other doesn't necessarily mean that it is better quality. In fact, there have been images where they were lower PSNR, but I considered them to be better quality than one with higher PSNR.
As such, when you answer your question, make sure you reference everything that I've said here.
tl;dr
: Though the histograms look equal, histograms are not spatially aware. The spatial relationships of pixels are not captured in histograms. As such, you could have a completely different looking image in comparison to another, but if you counted the amount of pixels per intensity, as long as the counts per intensity are equal, the histograms will be equal. Even with the histograms being unequal, doing PSNR does a point-by-point difference, and this (sort of) captures the spatial relationships of pixels and thus explains why the PSNRs are quite different.