Use pil lanczos.
This commit is contained in:
parent
de37d1abba
commit
5ffbf30a52
2 changed files with 2 additions and 2 deletions
|
@ -131,7 +131,7 @@ def load_image(filename):
|
||||||
image = PIL.Image.open(filename)
|
image = PIL.Image.open(filename)
|
||||||
(w, h) = image.size
|
(w, h) = image.size
|
||||||
(new_w, new_h) = imagetools.fit_into_bounds(w, h, 256, 256, only_shrink=True)
|
(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 = image.convert('RGBA')
|
||||||
image = imagetools.pad_to_square(image)
|
image = imagetools.pad_to_square(image)
|
||||||
return image
|
return image
|
||||||
|
|
|
@ -103,7 +103,7 @@ def resize(
|
||||||
raise ValueError('Cannot overwrite input file without OUTPUT_INPLACE.')
|
raise ValueError('Cannot overwrite input file without OUTPUT_INPLACE.')
|
||||||
|
|
||||||
log.debug('Resizing %s to %dx%d.', file.absolute_path, width, height)
|
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)
|
image = image.resize( (width, height), resampler)
|
||||||
|
|
||||||
if output_file.extension == '.jpg':
|
if output_file.extension == '.jpg':
|
||||||
|
|
Loading…
Reference in a new issue