How Image Compression Improves Page Speed and Core Web Vitals
Smaller images load faster and help Largest Contentful Paint. See what to compress, which format to use and how far to go.
Why images matter for speed
On many pages, images account for most of the bytes a browser has to download. The bigger the files, the longer visitors wait, especially on mobile connections. Slow pages frustrate people, and Google has said that page experience signals, including Core Web Vitals, are used by its ranking systems. They are one factor among many, and great content on a slightly slower page can still rank well, but there is no reason to leave easy wins on the table.
The Core Web Vitals images touch
Core Web Vitals are three measurements of real-world user experience. Images influence two of them directly.
- Largest Contentful Paint (LCP) measures how long the main content takes to appear. A good score is 2.5 seconds or less. On many pages the largest element is a hero image, so its file size and loading priority matter a great deal.
- Cumulative Layout Shift (CLS) measures unexpected movement of content. A good score is 0.1 or less. Images without declared dimensions push text down when they load.
- Interaction to Next Paint (INP) measures responsiveness. A good score is 200 milliseconds or less. Images affect it less, but very heavy pages can slow the browser overall.
The three steps: resize, compress, choose a format
Start by resizing. An image displayed 800 pixels wide should not be a 4000 pixel original. This alone often removes most of the file weight. Then compress: for photographs, a JPEG or WebP quality of about 75 to 85 percent usually looks nearly identical to the original at a fraction of the size.
Finally, choose the right format. WebP is supported by all current major browsers and typically creates smaller files than JPEG or PNG. AVIF can be smaller still but is slower to encode and may need a fallback in some workflows. Keep PNG for graphics that need lossless quality or transparency, and consider SVG for simple logos and icons.
Loading images the right way
Compression is only half the story. How images are placed on the page also affects the scores.
- Always set width and height attributes (or an aspect ratio in CSS) so the browser reserves space and avoids layout shift.
- Use loading="lazy" for images below the fold, but do not lazy-load the main hero image, because that delays LCP.
- Offer several sizes with srcset and sizes so phones download smaller files than desktops.
- In Next.js, the built-in Image component handles resizing, modern formats and lazy loading for you.
- Write descriptive alt text. It helps accessibility and gives search engines context.
How far should you compress?
There is no single perfect number. A reasonable approach is to compress until you can just begin to see a difference when comparing at full size, then step back slightly. Photos tolerate more compression than screenshots with text, where artefacts around letters show quickly. Always compare the before and after view and keep the original file in case you need to export again.
Mistakes to avoid
These are the issues we see most often on slow pages.
- Uploading camera originals straight to the site.
- Using PNG for photographs.
- Compressing an already compressed JPEG again and again.
- Lazy-loading the hero image.
- Leaving out image dimensions, which causes layout shift.
Measure the result
After optimizing, test with PageSpeed Insights or Lighthouse, and check the Core Web Vitals report in Google Search Console, which uses real visitor data. Make one change at a time so you know what helped.
Try it free
Image Compressor
Compress several images at once, compare before and after, and download them as a ZIP.
Frequently asked questions
Does image compression help SEO?
Indirectly. Faster pages improve user experience and Core Web Vitals, which are used by Google's ranking systems, though content relevance remains the most important factor.
What quality setting should I use for JPEG or WebP?
For photographs, roughly 75 to 85 percent is a good starting point. Compare the result at full size before settling.
Should I lazy-load every image?
No. Lazy-load images below the fold, but load the main above-the-fold image normally so it does not slow Largest Contentful Paint.
Keep reading
How to Resize Images Without Losing Quality: A Step-by-Step Guide
Pick the right dimensions and format, avoid repeated re-compression, and resize images in your browser without uploading them anywhere.
TutorialsUnderstanding PDF Compression: Lossless vs Lossy Settings
What actually makes a PDF large, which settings shrink it, and what you give up at each level.
Written by the ProTools Hub Team. This article is for general information. Features and browser support change over time, so check current documentation for anything critical.