54

How do I convert webp files to JPG format?

PJ Brunet
  • 3,615
  • 40
  • 37
lmlmlm
  • 699
  • 1
  • 5
  • 7
  • 2
    I think the question is specific and therefore not too broad: it simply asks: How to convert webp to jpg. However superuser.com would be a better home for it, assuming that it is not a programming question. – therobyouknow Jul 03 '18 at 10:17
  • In WIndows, open the .webp file in MS Paint and save as .jpg. :-) – EleventhDoctor Apr 12 '22 at 19:30

1 Answers1

124

Use ImageMagick v7:

magick input.webp output.jpg

Or ImageMagick v6:

convert input.webp output.jpg

If you have lots to do, use mogrify instead. So, say you want to convert all the WEBP images in the current directory to JPEG:

magick mogrify -format JPEG *.webp

And if you want the converted files in a directory called OUTPUT, use:

mkdir OUTPUT
magick mogrify -format JPEG -path OUTPUT *.webp
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
  • 8
    It does require that the webp and jpg delegates be installed with Imagemagick. See https://developers.google.com/speed/webp/download. You can see if it is installed using `convert -version` or `magick -version` as indicted by Mark above – fmw42 Mar 31 '18 at 21:52
  • 13
    In case you have many files: ```for i in *.webp; do name=`echo "$i" | cut -d'.' -f1`; echo "$name"; convert "$i" "${name}.jpg"; done``` – maaniB Mar 06 '21 at 16:31
  • 2
    @maaniB Actually there's a better way with `mogrify`, so I have updated my answer. – Mark Setchell Mar 06 '21 at 16:59
  • 10
    Convert single file: `ffmpeg -i myfile.webp myfile.jpg` Convert all files from the current directory recursively: `find . -iname '*.webp' -exec bash -c 'ffmpeg -y -i "$1" "${1%.*}.jpg"' _ {} \;` – ccpizza Apr 15 '22 at 11:22
  • 1
    I assume ImageMagick is cross platform. In any case, should we add "operating system" tags to the question, to try to get it reopened? – PJ Brunet Jun 13 '22 at 21:12
  • 1
    For `-path` you may need to create the directory first. – PJ Brunet Jun 17 '22 at 20:26
  • 1
    sudo apt install imagemagick – Felipe Jun 30 '22 at 03:37
  • 1
    It worked only for PNG, not JPEG. Am I missing an extension or something? – Wesley Gonçalves Aug 14 '22 at 20:58