Open simonfromla opened 6 years ago
Can you show me an example of an image created with Django ImageKit and another created with other tool but with better quality. Also you can post the options that you are giving to the Spec, versions of PIL/Pillow, OS version and original image in order to reproduce it.
The base image
created using ImageKit
done by github
Spec options:
profile_photo_thumbnail = ImageSpecField(source='profile_photo', processors=[ResizeToFill(50, 50)], format='PNG', options={'quality': 100})
Versions:
pilkit==2.0
Pillow==4.3.0
Django==1.11.8
Originally created in Mac OS X 10.11.3
I see that the image created by GitHub is more sharp. By default ImageKit uses PIL.Image.ANTIALIAS
(the same as PIL.Image.LANCZOS
) when resizing and probably this filter is makeing the image more blurry. Actually this should be the best filter from Pillow in respect to quality http://pillow.readthedocs.io/en/5.0.0/handbook/concepts.html#concept-filters
Probably will be better to add option to pass the filter to ResizeToFill
if some of the options give better results in some situations and developer to be able to set them.
You can try to install pilkit
from source and change these filters in the code (https://github.com/matthewwithanm/pilkit/blob/2.0/pilkit/processors/resize.py#L24) to see if some of them will give you better results or this is the best Pillow can do.
If some of them gives better result then we need to open new issue against pilkit to try to improve its logic of using Pillow.
Resizing an image to thumbnail size reduces quality drastically. Bumping up the
'quality'
inoptions={}
has almost no effect.What are some ways we can bump up the quality of a resized pic? Are there some steps we can take--maybe during initial photo upload, or during save--that might allow for better resized quality?
Am I simply using it incorrectly?