If you have MATLAB, you can use:
% Reading images as array to variable 'a' & 'b'.
a = imread('MIMICDatacollection.bmp');
b = imread('MIMICDatacollection.png');
% Flatten multidimensional arrays to 1D
c=a(:);
d=b(:);
% Perform comparison
if length(c) ~= length(d)
disp('The images do not have the same size')
else
e = corr2(c,d);
if e==1
disp('The images are same')
else
disp('The images are not same')
end;
end
Personally, I use it with PNG and BMP, but it should work for any format supported by imread
.
If you need to run it on a machine that doesn't have Matlab, you can turn it into a function and compile it to make it CLI.
If you don't have Matlab that should be easy to port in any high-level language with a decent imaging library, such as Python Imaging Library (PIL).
Related: How can I tell if I am downloading/saving duplicate images?