This is a Python script that converts images in a given folder to a specified file format.
- Batch image conversion
- Supported formats: WebP, PNG, JPG, JPEG, TIFF, BMP, and GIF
- Python 3
- Install Pillow (Python Imaging Library) by running
pip install pillow
- Install tqdm by running
pip install tqdm
- Clone or download the repository
- Add the images to be converted in a folder named
images
inside the repository - In
main()
function, setdestination_format
variable to the desired output format (e.g., 'jpg', 'png', 'bmp', etc.) - Run
python convert.py
in the command line to execute the script - After the conversion is complete, the images will be saved in the
converted
folder
To convert all images in the images
folder to webp format, set the destination_format
variable to 'webp':