Local image optimization tool in WebP/AVIF
A local tool for batch optimization of images in WebP/AVIF, developed for personal use as a convenient, minimalist, and efficient alternative to bulky online services.
I use it to prepare illustrations for publication on the websites I am developing — to obtain modern formats with maximum compression without loss of visual quality. At its core is the libvips library (via pyvips), which processes images in a streaming manner in chunks instead of loading them into memory all at once — this provides a speed that is 5–10 times faster than ImageMagick or Pillow, and allows working with very large files.
WebP is compressed with method=6 and smart_subsample, AVIF through the AV1 codec. If libvips is unavailable, there is an automatic fallback to Pillow with AVIF support via pillow-heif.
All files are processed in parallel using ProcessPoolExecutor. The interface supports drag & drop, click, and paste from the clipboard (Ctrl+V). There are three quality profiles, size selection with smart orientation consideration (landscape/portrait), auto-packaging into ZIP, and auto-cleanup after 10 minutes. Images do not leave the machine — fully local processing.
Stack: Python, FastAPI, libvips/pyvips, Pillow, Vanilla JS
I use it to prepare illustrations for publication on the websites I am developing — to obtain modern formats with maximum compression without loss of visual quality. At its core is the libvips library (via pyvips), which processes images in a streaming manner in chunks instead of loading them into memory all at once — this provides a speed that is 5–10 times faster than ImageMagick or Pillow, and allows working with very large files.
WebP is compressed with method=6 and smart_subsample, AVIF through the AV1 codec. If libvips is unavailable, there is an automatic fallback to Pillow with AVIF support via pillow-heif.
All files are processed in parallel using ProcessPoolExecutor. The interface supports drag & drop, click, and paste from the clipboard (Ctrl+V). There are three quality profiles, size selection with smart orientation consideration (landscape/portrait), auto-packaging into ZIP, and auto-cleanup after 10 minutes. Images do not leave the machine — fully local processing.
Stack: Python, FastAPI, libvips/pyvips, Pillow, Vanilla JS