/** Compare two images. May be BufferedImages or File arguments. */ public int compare(Object obj1, Object obj2) { try { obj1 = convertToJPEGFile(obj1); } catch (IOException io) { obj1 = null; } try { obj2 = convertToJPEGFile(obj2); } catch (IOException io) { obj2 = null; } Log.debug("Comparing " + obj1 + " and " + obj2); return comparator.compare(obj1, obj2); }