skip to main content
Avatar of Nicklas Jarnesjö
Nicklas Jarnesjö

Convert image format through unix terminal

code

This is a small script I use to convert images from example avif to webp through unix terminal. In this case because Microsoft Edge does not support avif images yet. I learned the hard way.

for image in ./*/*.avif ;  do convert "$image" "${image%.*}.webp" ; done

For this to work you need to have imagemagick installed on your system. imagemagick on Homebrew

brew install imagemagick
Discuss this post on Twitter