Open victordomingos opened 6 years ago
In this page, there is a more complete example, that accounts for the cases when after optimisation the resulting file is not smaller that the original, non optimised one:
https://www.softwariness.com/articles/reduce-image-file-sizes-using-python
Well, just submitted a PR for a quick change in the save function: https://github.com/AlexJF/pelican-advthumbnailer/pull/7
I have tried this plugin and it works properly. It's a nice add-on to the Pelican workflow. However, while testing for performance and optimisation, I have found that the resulting thumbnails are not fully optimised.
I know there are not a lot of Python options with regards to image processing, and I like the fact that this plugin does not require any weird dependency, but maybe there is something that could be done with PIL itself, like using the
quality
andoptimize
parameters, and/or making progressive JPGs (e.g.: https://stackoverflow.com/questions/6788398/how-to-save-progressive-jpeg-using-python-pil-1-1-7).