I have been using hugo for a while and wanted to give a little bit back to the community
As most of your probably know, unoptimized images on website are one of the biggest low hanging fruit to fix when it comes to performance on the web.
Since I have many large images on my blog I wrote a small script that will optimize images after the website is built by hugo. This means that the original pictures in your static/images
folder will be left untouched and only the ones in the public/images
folder are optimized.
It currently works for PNG and JPEG and will limit the width of pictures to 1400px.
You can find the script at https://github.com/b-m-f/hugo-picture-optimization .