avinash201199/MemeGenerator

Add Image Compression & Optimization

Open

#127 opened on Oct 21, 2025

 (0 comments) (0 reactions) (1 assignee)JavaScript (57 forks)auto 404
hacktoberfesthacktoberfest-accepted

Repository metrics

Stars
 (24 stars)
PR merge metrics
 (PR metrics pending)

Description

Implement image compression and optimization for generated memes to reduce file sizes and improve download speeds without compromising quality.

Current State

Generated memes are saved at full resolution, resulting in large file sizes that may be slow to download.

Tasks

  • Add image compression library (e.g., sharp in Node.js or Pillow in Python)
  • Implement multiple quality levels (high/medium/low)
  • Add compression settings in the API endpoint
  • Generate WebP format as alternative for better compression
  • Display file size info before download
  • Add compression settings UI in download dialog

Expected Output

  • Meme images are 40-60% smaller without noticeable quality loss
  • Users can choose compression quality
  • Download times are significantly reduced

Files to Modify

  • meme-bot/meme_generator_clean.py (add compression logic)
  • api/caption.js (add compression for Imgflip-generated memes)
  • src/components/Dynamicmeme.jsx (add UI controls)
  • src/Meme.jsx (add UI controls)

Technical Details

  • Use Pillow with optimize=True and quality parameter for Python
  • Consider JPEG quality: 70-80 for good balance
  • Add WebP format option for modern browsers

Contributor guide