Skip to content

Convert all kinds of images (JPG, PNG, BMP, HEIC, etc.) to WebP format via command-line.

License

Notifications You must be signed in to change notification settings

BaseMax/images2webp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

images2webp

Convert all kinds of images (JPG, PNG, BMP, HEIC, etc.) to WebP format via command-line.

License: MIT

📦 Features

  • 🔁 Supports JPG, PNG, BMP, TIFF, GIF, and HEIC formats
  • 📁 Converts a single directory or recursively scans subdirectories
  • 🗑️ Option to delete original files after conversion
  • 🪵 Logging with optional file output
  • ❌ Robust error handling and skipping invalid files

🚀 Usage

Install Dependencies

First, set up a virtual environment and install dependencies:

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

For Linux systems with HEIC support:

sudo apt install libheif-dev libde265-dev

Run Script

python images2webp.py <input_dir> <output_dir> [options]

Options

Option Description
-r, --recursive Recursively scan input directories
-d, --delete Delete original files after convert
-l, --logfile Write logs to a specified file

Example

python images2webp.py ./images ./webp --recursive --delete --logfile convert.log

MIT License - see LICENSE for details.

© 2025 Max Base

Releases

No releases published

Packages

No packages published

Languages