aspose file tools*
The moose likes Java in General and the fly likes Checking if two images are identical Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Checking if two images are identical" Watch "Checking if two images are identical" New topic
Author

Checking if two images are identical

Micho Lee
Greenhorn

Joined: Oct 21, 2003
Posts: 14
Is there a way to compare images or image objects in java to see if two images are identical?

Thanks a bunch!
Michael Fitzmaurice
Ranch Hand

Joined: Aug 22, 2001
Posts: 168
Hi Micho
You should be able to read the 2 image files as binary and compare them by performing a checksum on each. See the java.util.zip.CRC32 class for one such checksum mechanism.
Whether or not this is what you want depends on your definition of 'the same'. This method obviously requires them to be absolutley identical in their binary makeup. Perhaps you want some kind of fuzzy logic comparison of the graphical content of the images? If so, I can't think of any easy way to do that.
Hope this helps
Michael


"One good thing about music - when it hits, you feel no pain" <P>Bob Marley
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Checking if two images are identical
 
Similar Threads
Using a Comparator for the TreeSet class
Compare Two Images
identical hashcode values
Problem while using Birt with eclipse
Checking if two images are identical