A image hashing library written in Python. Supports:
Based on PIL Image, numpy and scipy.fftpack (for pHash)
>>> import Image >>> import ImageHash >>> hash = ImageHash.average_hash(Image.open('test.png')) >>> print hash d879f8f89b1bbf >>> otherhash = ImageHash.average_hash(Image.open('other.bmp')) >>> print otherhash ffff3720200ffff >>> print hash == otherhash False >>> print hash - otherhash 36
Demo function find_similar_images illustrates finding similar images in a directory.
References:
* pHash implementation following http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html * dHash implementation following http://www.hackerfactor.com/blog/index.php?/archives/529-Kind-of-Like-That.html