Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is most likely no translated for the post!




Share:
Notifications
Clear all

How to convert WEBP files to PNG in Terminal, DOS or Shell


 Hans
(@hans)
Noble Member Admin
Joined: 8 years ago
Posts: 1840
Topic starter  

Occasionally I run into pictures that I copy from websites, which Google Chrome then feels the need to store a .webp files.
Google states this on their format:

WebP is a modern image format that provides superior lossless and lossy compression for images on the web

I honestly do not know if this really is the case, but I do know it is annoying that most graphics applications (at the time of writing this) do not support the WEBP file format.

There are several methods to convert a WEBP file to something useful, for example online converters, and some desktop applications.
But there is a method that works straight from the command line (Terminal, DOS, Linux Shell) by using the Webp-tools from Google from here.

Select the one suitable for your OS, and extract the file.

You will find a tool in the archive called "dwebp" (in the bin directory), which "Decodes the WebP image file to (default) PNG format" as such:

./dwebp -o output.png input.webp

The tool also supports output as PAM (raw RGBA), PPM (raw RGB), BMP, TIFF, PGM and YUV.

If you would prefer for example BMP, then this can be doen as such:

./dwebp -bmp -o output.bmp input.webp

 

I'm not sure if this will work under Windows or Linux, but under MacOS I found that I can just copy the file (dwebp) to any location, and it doesn't seem to need any of the other files.


ReplyQuote
Topic Tags
(@vihadigital)
New Member
Joined: 2 months ago
Posts: 1
 

Thank you for such a valuable piece of information I will definitely try this with my images... 


Hans liked
ReplyQuote
 Hans
(@hans)
Noble Member Admin
Joined: 8 years ago
Posts: 1840
Topic starter  

👍 

If you don't mind using an online service, then EzGif.com is a good alternative as well, and it supports animated WEBP images to Animated GIF.


ReplyQuote

Like what you see and you'd like to help out? 

The best way to help is of course by assisting others with their questions here in the forum, but you can also help us out in other ways:

- Do your shopping at Amazon, it will not cost you anything extra but may generate a small commission for us,
- send a cup of coffee through PayPal ($5, $10, $20, or custom amount),
- become a Patreon,
- donate BitCoin (BTC), or BitCoinCash (BCH).

Share: