WebP is the future

Time to drop those old file formats and get with the times

install the dep (on MacOS)

1
brew install webp

run it

1
2
3
4
5
for file in $( find . -name "*.jpg" -o -name "*.png" )
do
  newname=`echo $file | sed s/.jpg$/.webp/ | sed s/.png$/.webp/`
  cwebp -noalpha -q 80 $file -o $newname
done

compare

1
2
3
❯ ls -lh img/bio.jpg
-rw-r--r--  1 hecate torchgroup 343K May 28 17:06 img/bio.jpg

1
2
❯ ls -lh img/bio.webp
-rw-r--r--  1 hecate torchgroup 157K May 28 19:54 img/bio.webp