Guide · File weight and speed

Images that don’t slow down your website

ImagenesXIA original illustration: a constellation of colorful stars joined by thin lines against a violet sky

Images are usually the heaviest part of a page. A homepage with a five-megabyte photo can take several seconds to appear on a phone with a poor signal, and Google measures that wait. The good news is that almost everything can be fixed with four decisions you make once.

The three figures Google measures

Core Web Vitals measure the real experience of visitors. For a page to be considered good, Google asks that the main element be rendered in 2.5 seconds or less (LCP), that the page respond to an interaction in 200 milliseconds or less (INP), and that the layout not shift while it loads, with a CLS value of 0.1 or less. Images mainly affect the first and the third.

Four decisions that fix almost everything

  1. The format. Use WebP or AVIF. According to Google’s studies, WebP takes up between 25% and 34% less space than a JPEG of comparable quality, and AVIF usually compresses even more. Current browsers support both.
  2. The right width. Don’t serve a 4,000-pixel image for an 800-pixel space. Prepare several widths (for example 480, 768, 1,200, and 1,920) and let the browser choose with srcset and sizes.
  3. Declared dimensions. Always set width and height on every image. The browser reserves the space and the page doesn’t jump: it is the simplest way to keep CLS low.
  4. When it loads. Images that sit below the first screen get loading="lazy". The main image is never deferred: on the contrary, give it fetchpriority="high" so that it arrives sooner.

A guide to reasonable file weights

UseTypical widthApproximate weight in WebP
Homepage image1,920 pxunder 250 KB
Article image1,200 pxunder 150 KB
Thumbnail or card480–600 pxunder 50 KB

These are working references, not Google rules: what counts is how long the image takes to appear on a real phone. Check it with PageSpeed Insights after every important change, and pay particular attention to the mobile result, which is the one Google uses to evaluate your page.

Background video without hurting speed

A background video can look spectacular, but it should never be the first thing that loads. Show a lightweight still image (the poster) first, load the video afterward, and on mobile consider sticking with the still image: it saves your visitors data and battery and protects your speed score.

Practical case: a homepage that was slow to load

An online ceramics store had a carousel on its homepage with five photographs of 2.5 MB each, all loaded when the page opened even though only the first one was visible. On a phone with poor coverage, the homepage took several seconds to show anything.

The solution didn’t require changing store platform or design. A single main image was kept, converted to WebP and served in three widths with srcset; the other four were moved further down, with lazy loading; and all of them were given a width and height in the HTML so the page wouldn’t jump as they loaded. The homepage started showing its main image much sooner, and the photos stayed the same.

Step by step to measure and fix

  1. Open Google’s PageSpeed Insights, type in your page’s address, and look at the mobile section.
  2. Look at the element that sets the LCP: very often it is an image.
  3. If it is, check its file size and its actual width; it is almost always larger than what is displayed.
  4. Convert it to WebP or AVIF and generate two or three widths so that each screen gets its own.
  5. Remove lazy loading from that main image and add it to the ones further down.
  6. Specify the width and height of each image so the page doesn’t jump, and measure again.

Common mistakes

  • Applying lazy loading to the main image, which is precisely the one that should arrive first.
  • Uploading the photo straight from the phone or camera, with thousands of pixels nobody will see.
  • Using PNG for photographs: it is a format designed for graphics and weighs much more.
  • Trusting the content management system to compress everything on its own: some do and some don’t.
  • Measuring only on the office computer, with a good connection, and not on a phone.

Questions people ask us

How much should an image weigh?

There is no single figure. The table of reasonable file sizes in this guide is a reference; what matters is that the page loads quickly on a phone.

Does an image lose quality when compressed?

A little, but with reasonable compression the difference isn’t noticeable to the naked eye, and the speed improvement is.

AVIF or WebP?

AVIF usually weighs less, but it takes longer to generate and not all tools support it. WebP is the most convenient balance today.

A quick checklist

  • The main image is light and doesn’t use lazy loading.
  • The other images use lazy loading.
  • They all specify their width and height.
  • None is served much larger than it is displayed.
  • Photographs are in WebP or JPEG, not PNG.

If someone else or an agency manages your website, send them this list as is: these are five checks that can be reviewed in a morning and don’t require changing the design or the content management system.