IMG2WEBP is a Python-based script/application for converting and optimizing images in bulk initially made for web development optimization.
Saw a Lighthouse report from Cloudflare indicating that my site was loading too slowly due to the images. Conventionally, I would have had to compress each image individually and then convert them to WEBP format. However, instead of doing this manually, I came up with the idea of creating a Python script that can handle this process in bulk for me.
After using this, my images folder size decreased significantly, from 105MB to just 9MB!
locally clone/download this repo, cd to the project folder and then follow these steps :
-
Make Virtual Environment :
python -m venv .env -
Acivate ENV :
.env\scripts\activate -
Install requirements :
pip install -r requirements.txt -
go to source code directory :
cd src -
Run
main.py:python main.py
If anyone ever sees this repo and would like to flex their Python skills, they can create the GUI that I conceptualized but didn't have time to code. figma-file-Link