Imagemagick batch convert to webp, without making an animation

1

I want to convert PNGs to webp, for that I use :

convert *.png -quality 90% -set filename:basename "%[basename]" "optim/%[filename:basename]".webp

Instead of writing one webp per png, I get one webp file with all the images as an animation.

I'm pretty sure I used a similar command in the past with success, I'm now using ImageMagick 7.0.8-68 on Macos.

What should I add to get individual WEBPs instead of an animation?

Edit: here's a full test case, ImageMagick installed through Homebrew, version 7.0.9-5 Q16 x86_64 2019-11-18

Create multiple PNGs :

for i in {1..9}; do convert -background black -fill grey -font impact -size 320x240 -pointsize 96 -gravity center label:$i out-$i.png; done

then attempt to convert to individual WEBPs:

convert *.png -quality 90% -set filename:basename "%[basename]" "optim/%[filename:basename]".webp

Result here is one WEBP file containing all images as an animation.

Vincent Tschanz

Posted 2019-11-06T10:03:19.790

Reputation: 63

2Your command fails for me because the folder optim did not exist. When the folder optim does exist it converts and does not create an animation. – somebadhat – 2019-11-17T17:58:28.190

Answers

1

Vincent Tschanz

Posted 2019-11-06T10:03:19.790

Reputation: 63