Skip to content

NishkarshRaj/image-super-compressor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Super Compressor

Reduces any image to under 1MB using iterative quality and resolution optimization.

Installation

pip install -r requirements.txt

Usage

# Basic usage (outputs to <filename>_compressed.jpg)
python compressor.py image.png

# Custom output path
python compressor.py image.png output.jpg

How It Works

  1. Converts image to RGB (handles PNG transparency)
  2. Iteratively reduces JPEG quality (85 → 20)
  3. If still too large, scales down resolution (10% increments)
  4. Repeats until file size is under 1MB

Example

python compressor.py Nish.png
# ✓ Compressed: Nish.png -> Nish_compressed.jpg
#   Size: 0.95MB | Quality: 45 | Scale: 100%

About

Compress any image to <1 MB - vibe-coded with Kiro-CLI

Topics

Resources

Stars

Watchers

Forks

Languages