This project provides a simple Python script to convert images from various formats (JPG, PNG, BMP, TIFF) to the WebP format using the Pillow library.
convert.py
converted_webp/
images/
convert.py: The main script for converting images.images/: Place your original images here.converted_webp/: Converted.webpimages will be saved here.
- Python 3.x
- Pillow
-
Clone or download this repository.
-
Install Pillow if you haven't already:
pip install Pillow
-
Place the images you want to convert inside the
images/folder. -
Run the conversion script:
python convert.py
-
The converted
.webpimages will appear in theconverted_webp/folder.
- Supported input formats:
.jpg,.jpeg,.png,.bmp,.tiff - The script will skip files that do not match the supported extensions.
Feel free to modify the script or folder names as needed