I believe ImageMagick includes some of the hash based methods which often do a DCT reduction and then do 2D analysis of similarity, emitting a hash code which you can do a hamming distance thing on. But thats a way off practical use to actuall find, stack, rename and identify the one golden one to keep in all the dupes.