Batch converting WEBP files to GIF/JPEG

Dec 31, 2018
31
73
Hey guys,

I'm trying to batch convert a whole folder I ripped from a website. Unfortunately, the images are all in WEBP (not WEBM) format but some are animated like gifs, while others are not. I've looked around a whole lot for tools that could do this, but unfortunately, everything I try either needs to be paid for (fuck that), or can only do one at a time, or dont work at all.

Does anyone have any solutions? I've tried using ffmpeg but I can't seem to get a correct command line down
 

Meushi

Well-Known Member
Aug 4, 2017
1,146
12,739
If you want a GUI: IrfanView & XnView/XnConvert are free, support webp & have batch conversion functions.

If you want command line batch processing, Google's dwebp & ImageMagick are free & support webp.

Working out which webp files are animated vs static would be trickier, no idea how you'd do that.
 
  • Like
Reactions: LongDongSliders69
Dec 31, 2018
31
73
Hmm, thanks for the info. I've already sifted through the images and have separated out the animated webp's from the stills, so that wont be an issue.

I tried using XnConvert but it failed. Saying it was unable to convert. I know the data isn't corrupted because I can open the file in my browser where it will play like a normal gif.

Then I ended up trying to use ImageMagick but for the life of me, I couldn't figure out the correct command line parameters to work the conversions. And this was after going through their entire documentation on their tool. However, I think ImageMagick may be the one I'll have to use considering the online converters that I've tested that worked use ImageMagick.

I'll keep trying in the meantime, but if you happen to know a general idea of what parameters to use, I can extrapolate from there.

EDIT: Nevermind, I figured it out. For anyone curious, the full command to convert .webps to .gifs but also maintain the same filename is:

magick convert *.webp -set filename:basename "%[basename]" "%[filename:basename].gif"
 
Last edited:
  • Like
Reactions: Meushi