pythonimagehash

Confusion about the minus operator for hashes from ImageHash library


I'm new to Python. As per this example (https://pypi.org/project/ImageHash/), what is the meaning of the following operation?

d879f8f89b1bbf - ffff3720200ffff

These appear to be hex strings. If that is the case, what operation is the - operator playing in this statement:

print(hash - otherhash)

Solution

  • These appear to be hex strings

    They're not, they're imagehash objects.

    As per this example (https://pypi.org/project/ImageHash/), what is the meaning of the following operation?

    Whatever imagehash defines them as, which looks to be the "distance" between the fingerprinted images, meaning the result indicates how similar the source images were.