Use pil lanczos.

This commit is contained in:
voussoir 2022-08-03 18:48:08 -07:00
parent de37d1abba
commit 5ffbf30a52
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB
2 changed files with 2 additions and 2 deletions

View file

@ -131,7 +131,7 @@ def load_image(filename):
image = PIL.Image.open(filename)
(w, h) = image.size
(new_w, new_h) = imagetools.fit_into_bounds(w, h, 256, 256, only_shrink=True)
image = image.resize((new_w, new_h), resample=PIL.Image.ANTIALIAS)
image = image.resize((new_w, new_h), resample=PIL.Image.LANCZOS)
image = image.convert('RGBA')
image = imagetools.pad_to_square(image)
return image

View file

@ -103,7 +103,7 @@ def resize(
raise ValueError('Cannot overwrite input file without OUTPUT_INPLACE.')
log.debug('Resizing %s to %dx%d.', file.absolute_path, width, height)
resampler = PIL.Image.NEAREST if nearest_neighbor else PIL.Image.ANTIALIAS
resampler = PIL.Image.NEAREST if nearest_neighbor else PIL.Image.LANCZOS
image = image.resize( (width, height), resampler)
if output_file.extension == '.jpg':