About Image Conversion to WebP

Convert PNG images to the new web-optimized WebP format using the png_to_webp.sh script defined as:

1
2
3
4
5
#!/usr/bin/env bash
for file in site_static/site/img/*.png
do 
cwebp -q 80 "$file" -o "${file%.*}.webp"
done

Analogously you can have another script for JPG image conversion.

Tips and Tricks Web Design Development HTML5 Bash Zsh