← Back to Blog
Performance SEO 9 min read

How to Make Your Website Load 3x Faster with Image Compression

Images are the #1 reason websites load slowly. Here's the exact playbook to fix it.

The Problem: Images Are Crushing Your Page Speed

According to the HTTP Archive, images account for an average of 42% of total page weight across all websites. On image-heavy sites like e-commerce stores, portfolios, and blogs, that number jumps to 60-75%.

Here's what that means in practice:

  • A typical blog post with 8 unoptimized images loads 12-15MB of image data
  • On a 4G mobile connection, that takes 8-12 seconds to fully render
  • Google's research shows 53% of mobile users abandon sites that take longer than 3 seconds to load
  • Every additional second of load time reduces conversions by 7%

The good news? Image optimization is the single highest-impact change you can make to improve page speed. By following the steps in this guide, you can reduce image payload by 70-90% and make your site load 3x faster.

Step 1: Choose the Right Image Format

The format you choose determines the baseline file size before any compression is applied. Choosing the wrong format is the most common mistake in web image optimization.

Use AVIF for Photographs (Best Compression)

AVIF delivers the smallest files for photographic content, typically 50% smaller than JPEG at equivalent visual quality. With 95%+ browser support in 2026, it's production-ready. Read our complete AVIF guide for details.

Use WebP as Your Safe Default

WebP produces files 25-35% smaller than JPEG with near-universal browser support (97%+). It's the safest modern format choice and supports both lossy and lossless compression, plus transparency.

Use SVG for Icons and Logos

Vector graphics like icons, logos, and simple illustrations should always be SVG. SVGs are resolution-independent, typically under 5KB, and scale perfectly on any screen size without quality loss.

Use PNG Only When Necessary

PNG is lossless and supports transparency, but produces large files. Use PNG only for screenshots, text-heavy graphics, or images where pixel-perfect accuracy matters. For everything else, WebP or AVIF is better.

Decision Matrix

  • Photo or hero image? → AVIF (with WebP/JPEG fallback)
  • Icon, logo, or illustration? → SVG
  • Photo with transparency? → WebP or AVIF
  • Screenshot or UI element? → PNG or WebP lossless
  • Animated content? → WebP animated or MP4 video (not GIF)

Step 2: Compress Your Images

Even with the right format, uncompressed images are unnecessarily large. Compression reduces file size by removing data the human eye can't perceive.

Lossy Compression (Recommended for Web)

Lossy compression removes visual information that most people can't distinguish. The results are dramatic:

  • JPEG at quality 75-85 - 60-80% size reduction with virtually no visible difference
  • WebP at quality 75-85 - 70-85% reduction from original PNG
  • AVIF at quality 60-80 - 80-90% reduction from original PNG

For most websites, quality 80 is the sweet spot. You'd need to zoom in 400% to spot the difference between quality 80 and quality 100.

How to Compress Images Fast

Use ZeroPNG's free Image Compressor to batch compress images directly in your browser:

  1. Drag and drop all your images into the compressor
  2. Set quality to 75-85% (adjust based on your needs)
  3. Select your output format (AVIF or WebP recommended)
  4. Click "Compress All"
  5. Download individually or as a ZIP

All processing happens locally in your browser. Your images are never uploaded to any server.

Step 3: Resize Images to the Right Dimensions

This is the most overlooked optimization. A shocking number of websites serve 4000px-wide images scaled down to 800px in CSS. The browser still downloads the full-size file.

The Rule of Thumb

Never serve an image wider than 2x the display size. For Retina/HiDPI screens, 2x is ideal. For standard screens, 1x is sufficient.

  • Blog content image (displayed at 800px) → serve at 1600px max
  • Thumbnail (displayed at 200px) → serve at 400px max
  • Full-width hero (displayed at 1440px) → serve at 2880px max, with smaller srcset variants
  • Product card (displayed at 300px) → serve at 600px max

Impact of Resizing

A 4000x3000 JPEG photo is typically 3-5MB. Resize it to 1600x1200 and it drops to 400-800KB. Add lossy compression and it's under 150KB. That's a 95%+ reduction from the original with no visible quality loss at the displayed size.

ZeroPNG's compressor includes a Max Width option that lets you cap image width at 4K, 1920, 1280, 800, or 400px while maintaining aspect ratio.

Step 4: Implement Responsive Images

Don't serve the same image to a 4K desktop monitor and a 375px-wide phone. Use HTML's built-in responsive image features:

The srcset Attribute

Serve multiple sizes and let the browser pick the most appropriate one:

<img
  src="photo-800.jpg"
  srcset="photo-400.jpg 400w,
          photo-800.jpg 800w,
          photo-1600.jpg 1600w"
  sizes="(max-width: 600px) 100vw,
         (max-width: 1200px) 50vw,
         800px"
  alt="Product photo"
  loading="lazy"
>

The picture Element (Format Switching)

Combine responsive sizing with modern format delivery:

<picture>
  <source
    srcset="photo-800.avif 800w, photo-1600.avif 1600w"
    sizes="(max-width: 600px) 100vw, 800px"
    type="image/avif">
  <source
    srcset="photo-800.webp 800w, photo-1600.webp 1600w"
    sizes="(max-width: 600px) 100vw, 800px"
    type="image/webp">
  <img src="photo-800.jpg" alt="Product photo" loading="lazy">
</picture>

This serves AVIF to Chrome/Firefox, WebP to older Safari, and JPEG as the ultimate fallback.

Step 5: Lazy Load Below-the-Fold Images

Images below the visible viewport shouldn't block the initial page render. Modern browsers support native lazy loading with a single attribute:

<img src="photo.webp" alt="Description" loading="lazy">

This tells the browser to defer loading the image until the user scrolls near it. The result:

  • Faster initial page load - only above-the-fold images load immediately
  • Less bandwidth consumed - images the user never scrolls to are never downloaded
  • Better Core Web Vitals - LCP and FCP improve significantly

Important: Don't Lazy Load the Hero Image

Your main above-the-fold image (hero, banner, first product photo) should load eagerly. Add fetchpriority="high" to signal its importance:

<img src="hero.avif" alt="Hero banner" fetchpriority="high">

Step 6: Set Proper Caching Headers

Once a visitor downloads an image, their browser should cache it so it doesn't download again on subsequent visits. Set aggressive cache headers for images:

# Nginx
location ~* \.(jpg|jpeg|png|webp|avif|svg|gif)$ {
    expires 1y;
    add_header Cache-Control "public, immutable";
}

# Apache (.htaccess)
<FilesMatch "\.(jpg|jpeg|png|webp|avif|svg|gif)$">
    Header set Cache-Control "public, max-age=31536000, immutable"
</FilesMatch>

Use content-hashed filenames (e.g., hero-a3f8d2.avif) so you can set year-long cache expiry without worrying about stale images. When the image changes, the filename changes, and the browser downloads the new version.

Step 7: Eliminate Metadata Bloat

Photos from smartphones and cameras contain EXIF metadata: GPS coordinates, camera settings, timestamps, and personal data. This metadata adds 10-100KB per image and provides zero value on the web.

Worse, it's a privacy risk. GPS coordinates in product photos can reveal your home address. Camera serial numbers can link your accounts across platforms.

Use ZeroPNG's EXIF Metadata Remover to strip all metadata from your images before uploading them to your website. It's free, browser-based, and processes files in batch.

The Impact: Before and After

Here's what a typical optimization looks like for a blog post with 8 images:

Before Optimization

  • 8 full-resolution JPEG images from a camera
  • Average size: 3.2MB each
  • Total image payload: 25.6MB
  • Page load time (4G): 14 seconds

After Optimization

  • Resized to max 1600px width
  • Compressed to WebP at quality 80
  • EXIF metadata stripped
  • Lazy loading enabled
  • Average size: 120KB each
  • Total image payload: 960KB
  • Page load time (4G): 3.8 seconds

That's a 96% reduction in image payload and a 3.7x improvement in load time.

Core Web Vitals and Image Optimization

Google uses Core Web Vitals as a ranking signal. Images directly affect two of the three metrics:

  • LCP (Largest Contentful Paint) - the time until the largest visible element renders. On most pages, this is an image. Compressing and properly loading your hero image is the single biggest LCP improvement
  • CLS (Cumulative Layout Shift) - images without explicit width and height attributes cause layout shifts as they load. Always specify dimensions in your HTML

Preventing Layout Shifts

Always include width and height attributes on <img> tags:

<img src="photo.webp" width="800" height="600"
     alt="Description" loading="lazy">

The browser uses these values to reserve space before the image loads, eliminating layout shifts.

Quick Checklist

Run through this checklist for every image on your site:

  1. Format - is it the right format? (AVIF/WebP for photos, SVG for icons)
  2. Compression - is it compressed at quality 75-85?
  3. Dimensions - is it sized at 2x the display width or less?
  4. Responsive - does it have srcset for multiple sizes?
  5. Lazy loading - does it have loading="lazy" (below fold)?
  6. Priority - does the hero image have fetchpriority="high"?
  7. Dimensions in HTML - does it have width/height attributes?
  8. Caching - are cache headers set with long expiry?
  9. Metadata - has EXIF data been stripped?

Compress Your Website Images Now

Use ZeroPNG to batch compress, resize, and convert your images for the web. Free, private, browser-based.

Optimize Images Now