Image.ANTIALIAS->Image.LANCZOS
This commit is contained in:
parent
b4fbb863af
commit
4414998759
1 changed files with 3 additions and 3 deletions
|
@ -57,7 +57,7 @@ def getHSL(rgb):
|
|||
return tuple(hsl)
|
||||
|
||||
def getImageHash(image_file, mode):
|
||||
image = Image.open(image_file).convert('RGB').resize((8, 8), Image.ANTIALIAS)
|
||||
image = Image.open(image_file).convert('RGB').resize((8, 8), Image.LANCZOS)
|
||||
image_hash = 0
|
||||
if mode == 'color':
|
||||
# divide the image into 8 zones:
|
||||
|
@ -99,7 +99,7 @@ def getImageHash(image_file, mode):
|
|||
return image_hash
|
||||
|
||||
def getImageHeat(image_file):
|
||||
image = Image.open(image_file).convert('RGB').resize((16, 16), Image.ANTIALIAS)
|
||||
image = Image.open(image_file).convert('RGB').resize((16, 16), Image.LANCZOS)
|
||||
pixel = image.load()
|
||||
image_heat = 0
|
||||
for y in range(image.size[1]):
|
||||
|
@ -114,7 +114,7 @@ def getImageHeat(image_file):
|
|||
return image_heat / 256
|
||||
|
||||
def getImageHSL(image_file):
|
||||
image = Image.open(image_file).convert('RGB').resize((1, 1), Image.ANTIALIAS)
|
||||
image = Image.open(image_file).convert('RGB').resize((1, 1), Image.LANCZOS)
|
||||
return getHSL(image.getpixel((0, 0)))
|
||||
|
||||
def getRGB(hsl):
|
||||
|
|
Loading…
Reference in a new issue