Get All 139 Premium WordPress Themes for Just $59.99
One-Time Payment: Unlimited Use Across Unlimited Domains, Plus Free Lifetime Updates!

How to Convert PNGs and JPGs in WebP format in Ubuntu

As described in previous post, it seems that WebP will be the future of images format used in websites. Here is a quick guide how to convert other image types such as PNGs and JPGs in WebP format in Ubuntu:

Install the webp package by running the following command in terminal:

$ sudo apt install webp

Again in terminal, navigate to parent directory of image you want to convert to WebP format. Then execute the following command (example image file name ‘test-image.png’):

$ cwebp -q 60 test-image.png -o test-image.webp

Convert Multiple Files

In case you want to convert multiple files to webp format, i.e. all png files to webp, it can be done by executing the following command:

$ for file in *
> do
> cwebp -q 60 "$file" -o "$file.webp"
> done

Leave a Reply