avinash201199/MemeGenerator

Add Image Compression & Optimization

Aperta

#127 aperta il 21 ott 2025

 (0 commenti) (0 reazioni) (1 assegnatario)JavaScript (57 fork)auto 404
hacktoberfesthacktoberfest-accepted

Metriche repository

Star
 (24 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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

Guida contributor