This blog is proxied by the nginx configuration in paskal/terrty.
YouTube's thumbnails with play button generated by this service. Example original thumbnails URLs:
https://img.youtube.com/vi/SFIEA_sAPhc/maxresdefault.jpg
https://img.youtube.com/vi/SFIEA_sAPhc/hqdefault.jpg
In order to make copies of images in a modern format to serve alongside with usual ones:
find ./static/images -type f -name '*.png' -exec sh -c 'avifenc --min 10 --max 30 $1 "${1%.png}.avif"' _ {} \;
Easier alternative than harden-than-I-thought task of getting avifenc working is converting images to avif using https://avif.io/.
It's easy to reduce the images size without altering their content:
find . -type f -iname "*.png" -exec optipng -o7 -preserve {} \;
find . -type f -iname "*.png" -exec advpng -z4 {} \;
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" \) -exec jpegoptim --strip-none {} \;