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
% Perform comparison
if length(c) ~= length(d)
disp('The images do not have the same size')
e = corr2(c,d);
disp('The images are same')
disp('The images are not same')
Personally, I use it with PNG and BMP, but it should work for any format supported by
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?