We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9777d09 commit 7e6af24Copy full SHA for 7e6af24
imagehash/__init__.py
@@ -160,7 +160,7 @@ def dhash(image, hash_size=8):
160
@image must be a PIL instance.
161
"""
162
image = image.convert("L").resize((hash_size, hash_size + 1), Image.ANTIALIAS)
163
- pixels = numpy.array(image.getdata(), dtype=numpy.float).reshape((hash_size + 1, hash_size))
+ pixels = numpy.array(image.getdata(), dtype=numpy.float).reshape((hash_size, hash_size + 1))
164
# compute differences
165
diff = pixels[:, 1:] > pixels[:, :-1]
166
return ImageHash(diff)
0 commit comments