Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert hash string into <class 'imagehash.ImageHash'> #204

Open
kucingkembar opened this issue Dec 25, 2023 · 0 comments
Open

convert hash string into <class 'imagehash.ImageHash'> #204

kucingkembar opened this issue Dec 25, 2023 · 0 comments

Comments

@kucingkembar
Copy link

sorry for stupid question again,
i got this code from your page

from PIL import Image
import imagehash
hash = imagehash.average_hash(Image.open('tests/data/imagehash.png'))
print(hash)
print(type(hash))# i edit this line
otherhash = imagehash.average_hash(Image.open('tests/data/peppers.png'))
print(otherhash)
print(hash == otherhash)
print(hash - otherhash)

as you can see, your hash can do some arithmetic,
i tried to convert from str : "ffd7918181c9ffff" or int : ffd7918181c9ffff
and both is fail ,
how to convert hash string into <class 'imagehash.ImageHash'>,
so i can do some arithmetic of it,

thank you,
have a nice day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant