PYYUPSK

a self-taught dev from Thailand

Pongsakorn Thipayanate · Samutsakhon, TH ·webring

active

imgbytesizer

A smart image resizer that hits an exact target file size, with optimized quality and format conversion.

Python / Pillow / CLI· 2025

GitHub →Website →

view .mdopen in claudeopen in chatgpt

A command-line tool that resizes images to an exact file size target. It uses binary search on quality and dimensions to find the best output.

Features

  • Exact file size: You specify the target size in bytes, KB, or MB.
  • Format conversion: The tool outputs JPEG, PNG, or WebP with optimal settings.
  • Quality optimization: The tool uses binary search on the quality parameter for the best visual result.
  • Batch processing: The tool resizes multiple files at once.
  • Progressive encoding: The tool uses progressive JPEG for smaller file sizes.

Usage

pip install imgbytesizer
imgbytesizer photo.jpg --size 500KB --output optimized.webp
imgbytesizer *.png --size 200KB --format jpeg

← All projects