mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-17 18:54:46 +03:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
96e3c0a853
commit
daf0b255a8
|
@ -2692,7 +2692,7 @@ class Image:
|
|||
if not ImageQt.qt_is_installed:
|
||||
raise ImportError("Qt bindings are not installed")
|
||||
return ImageQt.toqpixmap(self)
|
||||
|
||||
|
||||
def dhash(self) -> str:
|
||||
"""
|
||||
Calculate the dHash value of the picture. DHash value can be used to quickly determine the similarity of two pictures.
|
||||
|
@ -2749,7 +2749,7 @@ class Image:
|
|||
difference = [] # 64-bit boolean sequence
|
||||
|
||||
# convert to 9*8 grayscale image
|
||||
data = array(image.resize((resize_width, resize_height)).convert('L'))
|
||||
data = array(image.resize((resize_width, resize_height)).convert("L"))
|
||||
for row in range(resize_height):
|
||||
for col in range(resize_width - 1):
|
||||
difference.append(data[row, col] > data[row, col + 1])
|
||||
|
|
Loading…
Reference in New Issue
Block a user