DEV Community

Arhan Ahmad
Arhan Ahmad

Posted on

How to reduce image file size without losing quality (5 techniques)

The most common question I hear is, "How do I make this image smaller without making it look worse?" Here are five techniques that work every time.

1. Switch to a modern format

This is the single biggest lever. Converting a JPEG to WebP saves 25-35% with no visible difference. Converting to AVIF saves 50-60%.

2. Remove invisible metadata

Every photo from a modern smartphone carries embedded EXIF data — camera model, GPS coordinates, date, settings. This metadata can add 50-200 KB per image. Stripping it removes zero visual quality and protects your privacy.

3. Resize to the display size

The most common cause of oversized images is uploading a 4000-pixel-wide photo when the page displays it at 1200 pixels. That's over 10x the pixels needed.

4. Use lossless compression for graphics

For screenshots, logos, and images with text, lossy compression introduces visible artefacts around text edges. Use lossless WebP or PNG instead.

5. Target a specific file size

Instead of guessing at quality sliders, tell the compressor the exact file size you need. Many platforms have hard limits: 8 MB for Discord, 25 MB for Gmail, 10 MB for WhatsApp.


All five techniques are available for free at ToolBox Image — a privacy-first image toolkit that runs entirely in your browser. Nothing leaves your device. No sign-up required.

Top comments (1)

Collapse
 
l4nj1n9 profile image
Lan Jing

Sadly, ToolBox Image is not FOSS.