basic bitmap storage
Useful for comparing two JPEG images saved with a different compression ratios.

You can use these pictures for testing (use the full-size version of each):



50% quality JPEG

100% quality JPEG







link to full size 50% image

link to full size 100% image

The expected difference for these two images is 1.62125%

 
% Percentage difference between images
function p = PercentageDifferenceBetweenImages(im1,im2)
 
if numel(im1)~=numel(im2),
    error('Error: images have to be the same size');
end
 
d = abs(single(im1) - single(im2))./255;
p = sum(d(:))./numel(im1)*100;
 
disp(['Percentage difference between images is: ', num2str(p), '%'])