Batch PNG compression with a local web UI. Uses pngquant (lossy quantization) and oxipng (lossless strip/optimization) behind a clean interface.
- Local folder scanning — select a directory, scan recursively (optional), and pick which files to optimize
- Before/after preview — overlay and side-by-side compare views
- Three compression modes:
standard— pngquant + oxipng, best size reductionlossless— oxipng only, no color lossresize only— scale down, no quantization
- Output format — PNG (via pngquant/oxipng) or WebP (via Pillow's built-in encoder, no extra binary needed)
- Color protection — list hex colors to preserve in the palette
- Dithering toggle — smoother gradients (standard mode)
- Output directory — save results to any folder (or use the built-in ZIP download)
- Recent folder history — quick-access chips with per-item removal and clear all
- Auto-detect binaries — finds
pngquant/oxipnginbin/folder or system PATH - Cross-platform — Windows, macOS, Linux (pre-built exe for Windows; macOS/Linux users need
pngquant/oxipngon PATH)
Download the latest release from the Releases page and run ImageOptimizer.exe.
Windows SmartScreen: The exe is unsigned (code signing certificates cost $200+/year for open-source projects). On first run, SmartScreen may show "Windows protected your PC" — click More info → Run anyway. This is normal for unsigned open-source software.
git clone https://github.com/aREversez/image-optimizer.git
cd image-optimizer
pip install -r requirements.txt
python -m app # or: start.batOpen http://127.0.0.1:8090 in your browser.
The first run will auto-detect pngquant and oxipng in the bin/ folder and system PATH. See bin/README.md if a binary is missing.
- Enter a folder path — type or browse to select a directory, then click Scan Folder
- Review files — deselect any you want to skip, adjust quality/width/mode
- Protect colors (optional) — add hex colors like
#2ecc71to preserve - Start — click Start and watch the live progress log
- Compare & download — click any result's Compare button for before/after preview, then download individual files or the full ZIP
This app has no authentication and is meant to run on 127.0.0.1 only (the
default). It can read any directory you point it at and write to any path
you specify as the output folder — fine for local, single-user use, but
don't start it with --host 0.0.0.0 or a LAN address unless you fully
trust everyone on that network, since there's nothing stopping them from
reading or writing files on your machine through it.
- Source install: Python 3.10+ with
fastapi,uvicorn,Pillow,jinja2,python-multipart(pip install -r requirements.txt, orpip install -r requirements.lockfor the exact versions this was tested against) - Standalone EXE: Windows 10/11 64-bit, no Python required
image-optimizer/
├── app/ # Python web application
│ ├── main.py # FastAPI server & routes
│ ├── optimizer.py # pngquant/oxipng orchestration
│ ├── models.py # Pydantic request models
│ └── templates/ # HTML/CSS/JS frontend
├── assets/ # Logo, icons, banner images
├── bin/ # Binary dependencies (pngquant, oxipng)
├── images/ # Default scan directory (gitignored)
├── build_exe.py # PyInstaller build script
├── pyproject.toml # pip-installable package config
├── requirements.txt
└── start.bat
MIT