[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2022-04-08 02:52:40 +00:00
parent 96e3c0a853
commit daf0b255a8

View File

@ -2692,7 +2692,7 @@ class Image:
if not ImageQt.qt_is_installed: if not ImageQt.qt_is_installed:
raise ImportError("Qt bindings are not installed") raise ImportError("Qt bindings are not installed")
return ImageQt.toqpixmap(self) return ImageQt.toqpixmap(self)
def dhash(self) -> str: def dhash(self) -> str:
""" """
Calculate the dHash value of the picture. DHash value can be used to quickly determine the similarity of two pictures. 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 difference = [] # 64-bit boolean sequence
# convert to 9*8 grayscale image # 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 row in range(resize_height):
for col in range(resize_width - 1): for col in range(resize_width - 1):
difference.append(data[row, col] > data[row, col + 1]) difference.append(data[row, col] > data[row, col + 1])