Reading Time: 3 minutes

Batch Convert to WebP Image Frmat

Batch converting images to WebP format through the Windows command line is an easy and fast way to convert multiple images at once.

This is a simple python script that will convert all the images you have in a specific folder and put them in a new folder of your choise. The original images will be intact. Also you have the ability to adjust the quality of your new converted webp images.

You don’t need at all an image-editing software such as Photoshop, Gimp, etc. since this is a python script and runs in command line on Windows.

The extension/formats that this python script supports, in order to convert them to Webp are the following:

png, jpg, jpeg, bmp, tiff, tif, gif, tga, webp

Note: You can add as many file formats as you want, if you open up the script and add them manually.

Another nice to have python script, Batch resize images, you may find interesting. It can save you a lot of time, trust me, i have been there. If you don’t have Adobe products such as Photoshop or Bridge, that python script is going to save you a lot of time.

Before you Run the Script (Batch Resize Images):

Two things before you run the script:

First: In order to run the script you need Python. So open the command line and type python. After that, command line will prompt you to install Python. Complete the process.

Second: You also need Pillow (PIL fork) library. In the command line type:

That’s it, now you can run the script.

Note: If you already have Python and PIL fork, you can skip both steps and run the script, without any issue.

Batch Convert to Webp Image Format Python Script:

This is the python script:

You can also download it from here.

In order for the script to work in your case, you need to change just few things in the script.

  • input_folder & output_folder
  • quality of Webp

After you change those line of codes to reflect your specific needs, you just need to double click on that BatchConvertToWebP.py file, and it will run automatically.

After it finished the process, it will create an output folder in the destination you choose and it will save all the newly converted WebP images inside it.

If you have a lot of images, the Batch Convert to WebP Python script will do the heavy lifting for you.

inspire others:

Picture of Vladi Dan

Vladi Dan

Hey there. I am an experienced 3D Artist - Graphic Designer for over 7 years. Of course, the learning process doesn't really end. I am more than happy to share my personal knowledge with you guys. Let's create and learn some cool stuff together. I hope you join me on this creative trip.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related posts