Complete Guide to Image Compression for Web

The complete guide to image compression for web — lossy vs lossless, formats, and practical tools.

Image compression is the process of reducing image file size while maintaining acceptable visual quality. Understanding the different types of compression and when to use each is essential for building fast, professional websites.

Lossy vs Lossless Compression

  • Lossy compression (JPG, WebP lossy, AVIF): Permanently removes some image data. Invisible at typical settings (80–90% quality). Produces the smallest files for photographs.
  • Lossless compression (PNG, WebP lossless, GIF): Removes no image data. Preserves every pixel exactly. Better for graphics, text, and images requiring editing.

Compression by Image Type

Image TypeBest CompressionTarget File Size
PhotographLossy JPG or WebP 80–85%Under 200KB
Screenshot with textLossless PNGUnder 500KB
LogoSVG or lossless PNGUnder 50KB
IllustrationPNG or WebP losslessUnder 300KB

The Compression Workflow

  1. Resize to display dimensions first (biggest size reduction)
  2. Choose the right format for the content type
  3. Apply lossy compression at 80–85% for photos
  4. Apply lossless compression for graphics and screenshots
  5. Verify: view at 100% zoom for quality, check file size
  6. Upload and test page load speed improvement

The Most Common Compression Mistake

The most common mistake is compressing without resizing first. A 4000×3000px image at 85% quality is still 2–5MB — enormous for a website. Resize first to display dimensions, then compress — this typically reduces file size by 90%+ compared to compression alone.

Apply the complete image compression workflow for free at imgresizr.com — resize, choose format, and compress in one tool.