I'm using the ImageHash module to get hashes of images. I have this code:
hashSize = 8
imghash3 = []
image = "pic1.jpg"
imghash1 = imagehash.phash(Image.open(image))
print(imghash1)
>>>d1d1f1f3f3737373
imghash2 = str(imagehash.phash(Image.open(image), hashSize))
print(imghash2)
>>>11b97c7eb158ac
imghash3.append(bin( int(imghash2, 16))[2:].zfill(64))
print(imghash3)
>>>['0000000000010001101110010111110001111110101100010101100010101100']
So imagehash1
is the basic usage of the module.
Now what I don't understand is what kind of transformation the hashSize
made to the original string in imagehash2
and how the 3rd function convert the imagehash2
into a 64 bit string.