⚡ Web Performance

How to Compress Images for the Web Without Losing Quality

Large images are the single biggest cause of slow websites. Here's exactly what compression settings to use for each format — and how to get small files that still look sharp.

📅 March 2026⏱ 7 min read

Why Image Compression Matters for Websites

Images typically account for 50–70% of a webpage's total data. A single uncompressed photograph from a modern smartphone can be 5–10MB — enough to make a page feel slow even on a decent broadband connection, and genuinely painful on mobile.

Google's Core Web Vitals — specifically Largest Contentful Paint (LCP) — directly measure how quickly your main image loads. A slow LCP hurts your search rankings. Proper image compression is one of the highest-impact, lowest-effort improvements you can make to site performance.

📊 The Numbers

A well-compressed JPEG for web use typically lands between 80–300KB depending on dimensions. The same image unoptimised might be 3–8MB. That's a 10–20x difference — enough to turn a 3-second page load into under 1 second.

Choosing the Right Format First

Before you compress, make sure you're using the right format. The format choice can matter more than the compression level:

JPG / JPEG

Best for photographs

Lossy compression that works well on complex, continuous-tone images like photos. Not suitable for images with text, sharp edges, or transparency.

PNG

Best for graphics & transparency

Lossless compression. Use for logos, icons, screenshots, and images needing a transparent background. Often larger than JPG for photos.

WebP

Best for most web use

Google's modern format. Typically 25–35% smaller than equivalent JPG at the same visual quality. Supported in all modern browsers since 2020.

The practical rule: if you're adding images to a website today, use WebP wherever possible. Fall back to JPG for photographs and PNG for graphics that need transparency.

The Right Quality Settings for Each Use Case

Image TypeRecommended QualityTarget File SizeNotes
Hero/banner images (full-width)75–82%100–250KBResize to 1200–1440px wide first
Blog post inline images78–85%60–150KBResize to max 800px wide
Product photos (e-commerce)82–88%100–200KBHigher quality = better conversion
Thumbnails70–78%15–50KBSmall display size hides artefacts
Background images65–75%80–200KBUsually overlaid with text anyway
Email attachments75–82%Under 500KBMost email clients limit attachments

The Compression Process: Step by Step

Step 1: Resize before you compress

Compression quality settings only reduce file size within the existing dimensions. A 4000x3000px image compressed to 80% quality is still enormous because of the sheer pixel count. Resize first, then compress.

For a full-width website image, 1400–1600px wide is sufficient for most screens including retina displays. A blog post image rarely needs to exceed 800px wide.

Step 2: Compress to your target quality

Use Private Image Compressor to compress the resized image. For most web use, start at 80% quality and check the result. If the "% Saved" figure is under 30%, try reducing to 75%. If you can see compression artefacts (blockiness or ringing around edges), increase to 85%.

Step 3: Check the output visually

The numbers matter less than your eyes. Zoom into areas of fine detail in the compressed image — hair, fabric texture, foliage. If it looks acceptable, it will look acceptable to your visitors. If you see noticeable degradation, increase quality by 5% and recompress.

Step 4: Verify the file size

For standard web images, you're aiming for under 200KB. For critical above-the-fold images, under 100KB. The live stats panel in Private Image Compressor shows original vs compressed size and percentage saved in real time.

✅ A Practical Benchmark

If your compressed image is more than 300KB, something is likely wrong — either the dimensions are too large, the quality setting is too high, or the original image had an unusually high resolution. Start by checking dimensions first.

Progressive vs Baseline JPEG

Standard (baseline) JPEGs load top-to-bottom — visitors see a partial image rendering as it downloads. Progressive JPEGs load in multiple passes, showing a blurry version first that sharpens as more data arrives. For large images, progressive loading feels noticeably faster to users even if the raw download time is the same.

Most browser-based compressors output baseline JPEGs. If progressive JPEG output matters to you, tools like Squoosh give you explicit control over this setting.

Converting to WebP

WebP offers the best compression efficiency for web use. A JPG compressed to 80% quality and then converted to WebP at equivalent quality will typically be 25–35% smaller still.

The catch: older browsers (IE11, some older Safari versions) don't support WebP. In practice this affects a small and shrinking fraction of web traffic, but if you need to support older browsers, serve WebP with a JPG fallback using the HTML <picture> element.

Frequently Asked Questions

What's the best image format for websites in 2026?

WebP for most images — it offers the best combination of compression efficiency and browser support. Use PNG specifically for logos, icons, and images requiring transparency. Use JPG as a fallback for browsers that don't support WebP.

Does compressing images affect SEO?

Yes — positively. Faster page load times (which compressed images contribute to) are a Google ranking factor. Specifically, Core Web Vitals scores (LCP, CLS) are affected by image loading. Properly compressed images can meaningfully improve your search rankings.

How much can I compress a photo before it looks bad?

For JPEG, most people can't detect quality reduction above 70–75% at normal viewing sizes. Below 60%, artefacts become visible to most people. The exact threshold depends on the image content — images with fine texture or sharp edges show compression artefacts more readily than smooth images like landscapes or portraits.

Should I compress PNG files?

PNG compression is lossless, meaning file size reduction is limited. For photos saved as PNG, converting to JPG or WebP first will dramatically reduce file size. For graphics, icons, and images with transparency, PNG compression is worth doing but won't achieve the dramatic reductions possible with JPEG.