I understand that you want to compare two images but there can be multiple ways to compare images. Once you load an image into MATLAB workspace, it is stored as matrix. So, you can use any technique that can be used to compare two matrices for the images as well. For example- You can use the 'corr2' function to get a scalar value of correlation coefficient or you can use the 'isequal' function to test the equality of the images. Similarly, you can use any other statistical function for that matter.