Skip to content
← All posts/
compressionJuly 8, 2026 Β· 4 min read

How to compress images without losing quality

The science behind image compression β€” lossy vs lossless, quality settings, and how to shrink files by 60-80% without visible degradation.

M

Motionix

Practical guides with sources and explicit limitations.

Close view of hands using a laptop
Burst / Pexels
Jump to

A 12 MB photo doesn't need to be 12 MB. Modern compression algorithms can shrink most images by 60-80% without any visible difference at normal viewing distances. Here's how it works and how to use it.

Lossy vs lossless compression

Lossless compression reduces file size without discarding any data. The decompressed image is pixel-identical to the original. PNG uses lossless compression.

Lossy compression discards data that humans are unlikely to notice. JPEG uses lossy compression. The quality setting (1-100) controls how much data is discarded.

The quality sweet spot

For JPEG:

  • Quality 95-100: Visually identical to original. File size: 40-60% of original.
  • Quality 80-90: Indistinguishable at normal viewing. File size: 20-40% of original.
  • Quality 60-70: Slight artifacts visible on close inspection. File size: 10-20% of original.
  • Below 60: Visible quality loss. Only use for thumbnails.

For most web and email use, quality 80-85 is the sweet spot.

PNG optimization

PNG compression is lossless, but you can still optimize:

  • Remove metadata. EXIF data, color profiles, and comments add bytes.
  • Reduce color depth. If the image doesn't need 16 million colors, use a palette.
  • Strip alpha channel. If you don't need transparency, remove it.

WebP and AVIF

Modern formats compress better than JPEG:

  • WebP: 25-35% smaller than JPEG at equivalent quality
  • AVIF: 50% smaller than JPEG at equivalent quality

Browser support:

  • WebP: 97% of browsers (2026)
  • AVIF: 90% of browsers (2026)

When to compress

  • Email attachments. Most mail servers cap at 10-25 MB.
  • Web pages. Page speed directly impacts SEO and user experience.
  • CMS uploads. WordPress, Squarespace, and others have upload limits.
  • Storage. Cloud storage costs add up with large files.

When not to compress

  • Archival masters. Keep originals uncompressed for future editing.
  • Print production. Print shops need maximum quality.
  • Before editing. Compress after all edits are done, not before.

Quality-slider sweet spots by format

The "quality" number means something different in each encoder, so the same value is not comparable across formats. Use these ranges as starting points, then verify by eye:

FormatWeb-safe qualityTypical size vs originalNotes
JPEG80-8520-40%Below 70 shows blocking in skies and gradients
WebP (lossy)75-8215-30%WebP holds detail lower than JPEG; 78 β‰ˆ JPEG 85
AVIF50-6310-25%AVIF's scale is different β€” 55 is already high quality
PNG (lossless)n/a40-70%Quality is fixed; savings come from palette reduction

A practical rule: encode two or three versions around the recommended value, compare them at 100% zoom, and keep the smallest one that still looks clean.

A visual quality checklist before you ship

Compression artifacts hide in predictable places. Before publishing, inspect the compressed file at 100% zoom and check:

  1. Smooth gradients β€” skies, shadows, and soft backgrounds are the first to show banding or blocky patches.
  2. Skin tones β€” faces reveal color shifts and mottling that landscapes hide.
  3. Text and sharp edges β€” logos and captions get a halo (ringing) when over-compressed.
  4. Fine texture β€” hair, fabric, and foliage lose detail and turn mushy.
  5. Dark areas β€” deep shadows show blocking artifacts more than bright areas.

If any of these look wrong, raise the quality by 5-10 points and re-export rather than accepting the smaller file.

Compress in the right order

Order matters β€” resizing after compressing wastes quality:

  1. Resize first to the largest size you will actually display. A 4000px photo shown at 1200px is carrying 3x too much data. Use Photo Resizer to set exact dimensions.
  2. Strip metadata you don't need (EXIF, GPS, thumbnails).
  3. Compress last with Image Compressor, targeting the quality range above.
  4. Verify against the checklist, then ship.

For a survey of dedicated tools and how they differ, see the best free image compressors. If you are unsure whether you need to shrink dimensions or just file size, image compressor vs resizer explains which tool solves which problem.

Frequently Asked Questions

Does compressing an image reduce its dimensions?

No. Compression reduces file size (bytes) while keeping the same pixel dimensions. To change width and height you need to resize, which is a separate step.

Can I recover quality after compressing?

No. Lossy compression permanently discards data. Always keep an uncompressed master and compress a copy, so you can re-export at higher quality later if needed.

Is repeatedly saving a JPEG bad?

Yes. Each lossy save re-compresses and adds new artifacts (generation loss). Edit from the original and export once, rather than opening and re-saving the same JPEG.

What quality should I use for photos on a website?

Start at JPEG 80-85 or WebP 75-82. That is visually identical to the original for most photos while cutting file size by 60-80%.

Share

Keep reading

Conversation

Join the conversation

Share a useful question, correction, or practical tip. Comments are reviewed before they appear.

Loading…

Motionix

A focused tool for your next step

Choose the right task and check its formats, processing and limits before starting.

Open tools