From 5ffbf30a521a4c12540a3d89938fbcc5fdb7b8ae Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Wed, 3 Aug 2022 18:48:08 -0700 Subject: [PATCH] Use pil lanczos. --- icoconvert.py | 2 +- resize.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/icoconvert.py b/icoconvert.py index 633646e..1f5a9da 100644 --- a/icoconvert.py +++ b/icoconvert.py @@ -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 diff --git a/resize.py b/resize.py index 2bf00d9..f5d55b0 100644 --- a/resize.py +++ b/resize.py @@ -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':