diff --git a/imagehash/__init__.py b/imagehash/__init__.py index 71cd878..54df7aa 100644 --- a/imagehash/__init__.py +++ b/imagehash/__init__.py @@ -160,7 +160,7 @@ def dhash(image, hash_size=8): @image must be a PIL instance. """ image = image.convert("L").resize((hash_size, hash_size + 1), Image.ANTIALIAS) - 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)) # compute differences diff = pixels[:, 1:] > pixels[:, :-1] return ImageHash(diff)