pixopt¶
A powerful, easy-to-use Python library and CLI tool for optimizing images for web and storage.
   
What is pixopt?¶
pixopt is a fast Python image optimizer designed for modern web workflows. It provides both a rich command-line interface (CLI) and a clean Python API to resize, compress, convert formats, generate responsive assets, extract lazy-loading placeholders, and detect the optimal format automatically.
Whether you are a developer automating image pipelines, a designer preparing assets, or a DevOps engineer optimizing static sites, pixopt handles the heavy lifting so you don't have to.
Highlights¶
- ๐ผ๏ธ Format conversion โ JPEG, PNG, WEBP, AVIF, GIF, HEIC/HEIF, SVG
- ๐๏ธ Animated GIF โ WEBP โ convert animated GIFs to much lighter animated WEBP
- ๐งน SVG minification โ pure-Python SVG cleanup (no Node.js tools needed)
- ๐ฑ HEIC/HEIF import โ open iPhone photos directly via
pillow-heif - ๐ฏ Lossless mode โ lossless PNG/WEBP compression for UI assets
- ๐ Adaptive quality โ binary-search quality to hit a target file size
- ๐ Visual comparison โ interactive HTML before/after slider
- ๐ Responsive srcset โ generate multiple width variants + HTML snippets
- ๐จ Lazy-loading placeholders โ dominant color, LQIP data URI, blurhash
- ๐ง Smart format detection โ auto-select WEBP/JPEG/PNG based on content
- ๐พ Backup originals โ copy originals before processing
- โก Batch processing โ single files, directories, or multiple files at once
- ๐ป Beautiful CLI โ built with Typer for an intuitive experience
Quick Start¶
Next Steps¶
- :material-rocket-launch: Installation โ Install pixopt on your system
- :material-console: CLI Usage โ Learn every CLI command with examples
- :material-code-braces: Library Usage โ Use pixopt programmatically in Python
- :material-api: API Reference โ Browse the full auto-generated API docs
- :material-source-branch: Contributing โ Set up your dev environment and contribute
License¶
MIT License โ see LICENSE for details.