AlexJF / pelican-advthumbnailer

Plugin for Pelican to allow flexible generation of thumbnails.
Apache License 2.0
7 stars 7 forks source link

Image optimisation #6

Open victordomingos opened 6 years ago

victordomingos commented 6 years ago

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 qualityand optimize parameters, and/or making progressive JPGs (e.g.: https://stackoverflow.com/questions/6788398/how-to-save-progressive-jpeg-using-python-pil-1-1-7).

victordomingos commented 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

victordomingos commented 6 years ago

Well, just submitted a PR for a quick change in the save function: https://github.com/AlexJF/pelican-advthumbnailer/pull/7