WebP Image Converter
A fast, safe batch image-to-WebP converter for Windows with an interactive Terminal UI (TUI) and a scriptable CLI, powered purely by Pillow (libwebp) — no external binaries required.
Looking for v1.0 (Flask Web UI,
cwebp/ExifTool, and Stable Diffusion metadata)? Check out thev1.0.0git tag.
Features
- Interactive Terminal UI (
webp-converter): Browse folders, preview file counts and sizes, adjust settings, watch live per-file progress and space saved, or cancel mid-batch. - Scriptable CLI: Pass a folder path and flags for automated/batch workflows with clean exit codes (
0success,1partial failure/skip,2fatal error). - Pure Python / Pillow: Converts JPG, JPEG, PNG, TIFF/TIF, BMP, and GIF (including animated GIFs to animated WebP) in-process — no
cwebp.exeorExifToolsetup needed. - Lossy or pixel-exact lossless: Configurable quality (
0–100) and compression effort (method 0–6), or lossless encoding with exact RGB preservation under transparency. - Metadata preservation: Carries over EXIF tags, ICC color profiles, XMP packets, and standard PNG/GIF/BMP text comments (
Author,Software,Comment,Creation Time), and automatically applies EXIF orientation to static images. - Safe by default:
- Original files are kept unless
--delete-originals(or the TUI toggle) is enabled. - Files are written atomically via temp files and originals are only removed after verified output.
- Never overwrites silently:
photo.jpg+photo.pngbecomephoto_jpg.webp+photo_png.webp, and existing.webpfiles are left alone unless--overwriteis set.
- Original files are kept unless
Requirements
- Windows 10 / 11 (Windows Terminal recommended for the TUI)
- Python 3.9 or higher
Installation
Recommended: install globally from PyPI
Using uv or pipx (adds webp-converter to your PATH in an isolated environment):
uv tool install webp-tui
# or
pipx install webp-tui
Or with pip:
pip install webp-tui
After installation, webp-converter can be launched from any folder in PowerShell, Command Prompt, or Windows Terminal.
Installing from local source (development)
# Global editable install with uv:
uv tool install -e .
# Or inside a virtual environment:
pip install -e ".[dev]"
Running without installing globally
pip install -r requirements.txt
python WebP-Image-Converter.py
Or double-click / run run-webp-converter.bat.
Usage
Interactive Terminal UI (TUI — Default)
Run with no arguments, or pass a starting folder path:
webp-converter
# or open directly on a folder:
webp-converter C:\Users\Name\Pictures\Batch
Highlights:
- Nord Studio layout with framed panes, live KPI summary bar (total files, before/after size, % saved, errors), and collapsible folder sidebar with Windows drive buttons.
- Interactive Queue table: filter files live, toggle individual files in/out with
Space, spot stem-collision renames before running, and click Retry Failed if any file errors. - Quick Presets: High Quality, Web Balanced, Max Compression, Lossless, or Custom, plus checkbox format selection in the Settings tab.
Keybindings inside the TUI:
1/2/3: Switch between Queue, Settings, and Log tabsB: Toggle folder sidebar/: Filter queue by filename or extensionSpace: Toggle highlighted file in Queue (or format checkbox in Settings)Ctrl+R: Start conversionCtrl+D: Dry run (preview output filenames in the Log tab without writing files)Esc: Cancel a running batch (or clear active filter)Ctrl+P: Open Command PaletteCtrl+Q: Quit
Command-Line Interface (CLI — Secondary)
Pass --cli along with a folder path and flags for headless/scripted runs:
webp-converter --cli C:\Users\Name\Pictures\Batch [OPTIONS]
Options
--cli: Run in headless command-line mode instead of opening the TUI--tui: Force the interactive terminal UI (default)--quality, -q: WebP quality0–100(default:90)--lossless/--lossy: Pixel-exact lossless encoding / force lossy--method, -m: WebP compression effort0–6(0fastest,6smallest; default:4)--keep-originals: Keep original files after conversion (default)--delete-originals: Delete original files after successful conversion--overwrite: Overwrite existing.webpfiles instead of choosing a new name--recursive/--no-recursive: Also scan subfolders (skips hidden/system/dev folders) / selected folder only (default)--workers, -w: Number of worker threads (default: CPU count)--dry-run: Preview planned conversions without modifying any files--formats: Supported extensions (default:.jpg .jpeg .png .tif .tiff .bmp .gif)--log-file: Write detailed logs to a file--verbose, -v: Enable debug logging--config: Path to a JSON configuration file
Examples
# Convert a folder at quality 85
webp-converter --cli D:\Photos --quality 85
# Lossless conversion, deleting originals only after success
webp-converter --cli D:\Screenshots --lossless --delete-originals
# Top-level folder only, dry run
webp-converter --cli D:\Uploads --no-recursive --dry-run
# Maximum compression effort with 8 worker threads
webp-converter --cli D:\Exports -q 80 -m 6 -w 8
Configuration
Settings can be saved from the TUI (Save Config) or edited in config.json (or %APPDATA%\webp-converter\config.json when installed globally):
{
"webp_quality": 90,
"lossless": false,
"method": 4,
"delete_originals": false,
"overwrite": false,
"recursive": false,
"supported_formats": [".jpg", ".jpeg", ".png", ".tif", ".tiff", ".bmp", ".gif"],
"max_workers": 8
}
Command-line flags always override config.json.
Running the tests
pip install -r requirements-dev.txt
python -m pytest
Metadata
Release files for webp-tui 2.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| webp_tui-2.0.2.tar.gz | 41.9 kB | Without provenance | Details for webp_tui-2.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| webp_tui-2.0.2-py3-none-any.whl | Python 3 | none | any | Details for webp_tui-2.0.2-py3-none-any.whl |
Total release size: 76.4 kB
Release files / webp_tui-2.0.2.tar.gz
| Download URL | webp_tui-2.0.2.tar.gz |
|---|---|
| Size | 41.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5957e81c77486f272d70edff9a382f36e3f34922404ca11351bcd7a59033d41f
|
|
BLAKE2b-256 checksum How to use checksums |
da94f65e7976fca5f898819af5ef1911aecec073aad635bab7b176a9f6871026
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.16
|
Release files / webp_tui-2.0.2-py3-none-any.whl
| Download URL | webp_tui-2.0.2-py3-none-any.whl |
|---|---|
| Size | 34.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
35a12502c5f86b378ce31aa5ce29e8662f919789b2c8cdf506709df6441acd86
|
|
BLAKE2b-256 checksum How to use checksums |
1169e6d9777dedf7323d6cac6c838b28d6e1d9ecd63270d9ea45f39f0fff2939
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.16
|
Security for webp-tui 2.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.