Skip to main content
01

imgbytesizer

Smart image resizer that hits exact target file sizes with optimized quality — available as CLI and VS Code extension.

PythonPillowCLIPyPI

About

A Python CLI tool built with Pillow that resizes images to an exact target file size while maintaining aspect ratio. Uses a binary search algorithm to find the optimal dimensions and quality settings, with format conversion support (JPEG, PNG, WebP).

Also available as a VS Code extension.

Usage

bash
# Resize to 500KB
imgbytesizer large_photo.jpg 500KB
 
# Convert to WebP at 1MB
imgbytesizer image.png 1MB -f webp
 
# Hero image under budget with minimum width
imgbytesizer hero.jpg 200KB --min-dimension 1200