23

I have an .webp image that I want to use in my Latex document. However, I can't really find how to use it or is it simply not possible with Latex?

Aaron
  • 649

1 Answers1

15

You probably need to convert the image to png. A freely available convertor precompiled for windows/linux/mac is available from

https://developers.google.com/speed/webp/download

then

dwebp image.webp -o image.png

should produce a usable file.

David Carlisle
  • 757,742
  • 1
    The link suggests it's a conversion tool to .webp. Does it also convert from .webp? – Werner Nov 29 '12 at 19:00
  • 5
    Well, I was hoping Latex would support it or that there would be a package available to add this function. – Aaron Nov 29 '12 at 19:01
  • 1
    well if you want latex to do it on the fly you could enable shell escape and set up a graphics rule for .webp such that it executes the conversion (a lot of people do this for eps/pdf conversion in pdftex) but really it's simpler just to convert it once and include the png directly unless it is changing all the time. – David Carlisle Nov 29 '12 at 19:03
  • Mac users: brew install webp. – jvriesem Aug 21 '22 at 19:09
  • Ubuntu (Linux) users: sudo apt install webp – Vladimir S. Mar 05 '23 at 13:24
  • I noticed that wbp images are much smaller than the converted PNG or PDF. Random example: from 67kb to 814kb. More and more images are available in the wbp format. – PatrickT Jun 19 '23 at 18:47
  • 3
    @PatrickT but unless the pdf format is changed to support webp, including them in latex will necesarily be slower and not have smaller final pdf as each webp will need to be converted to a form that can be included – David Carlisle Jun 19 '23 at 18:59
  • @DavidCarlisle, makes sense, thanks for the clarification David! – PatrickT Jun 19 '23 at 22:21