Comments (4)
This is screwing me over. I'm finding no way to use get_num_bits with any form of variable that converts it to a hex number. With all the excuses in the book, no str, no int even when it's hex.
Only way is to manually enter hex numbers, and then this is rendered useless.
from dhash.
Sorry, but I'm not really sure what you're asking. Most functions that convert to hex return a str in Python, for example the built-in hex()
function. There's no such thing as a "hex type", at least not in the standard library.
If you want to use get_num_bits_different()
, first call dhash_int()
on both images (this returns an integer), then pass the results of those to get_num_bits_different()
. For example, see here: https://github.com/Jetsetter/dhash/blob/master/dhash.py#L281-L283
from dhash.
image1 = Image.open('image_name.jpg')
hash1 = dhash_int(image1)
Traceback (most recent call last):
File "*", line 105, in
hash1 = dhash_int(image1)
NameError: name 'dhash_int' is not defined
from dhash.
How are you importing dhash
? If you're using import dhash
then you'll have to type dhash.dhash_int()
Otherwise you can do from dhash import dhash_int
and then use it directly.
from dhash.
Related Issues (9)
- can't get correct dhash from a icon picture HOT 2
- get_num_bits_different() is ambiguous HOT 1
- Get CI tests working again, particularly macOS
- handling of transparancy HOT 2
- AttributeError: 'module' object has no attribute 'dhash_row_col' HOT 2
- Optimize dHash HOT 1
- [Question] Why add Y-direction 64-bit hash? HOT 1
- Deprecation warning with regards to pillow HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dhash.