title: Best way to compare 2 images in Java jUnit?
body: <p>I'm writing a junit test case to validate a cropping and resizing class.  The class is fairly simple, it just delegates the calls to ImageMagick via Im4Java.  But to do things properly, I am trying to write up a jUnit test case.</p>
  
  <p>I manually created expected result images using Photoshop and am trying to compare them to the images produced by my crop/resize class.  The problem is that the headers that ImageMagick write and those by Photoshop differ.  So a simple byte-by-byte comparison will not work.</p>
  
  <p>ImageMagick offers a compare function, which when run from command line shows no pixel differences between the expected result and that produced by my class.  But Im4Java does not provide any wrapper methods to this compare function.</p>
  
  <p>Short of having to call Runtime.exec() myself, is there a way I can compare these two images in my test case?</p>