Pixel Bench

Preparing images for a website that loads fast

Images are usually the largest thing on a page by a wide margin. Getting them right is the single biggest performance win available, and most of it is decided before you touch a quality slider.

Serve the size you actually display

This is where most of the waste is. An image displayed in a 600-pixel-wide column does not benefit from being 4000 pixels wide — the browser downloads all of it, then throws away 97% of the data to draw it.

The rule: export at roughly twice the display width, capped at something sensible. Twice, because high-density screens draw two physical pixels per CSS pixel and will otherwise look soft. So a 600-pixel column wants a 1200-pixel image, not a 4000-pixel one.

For a full-width hero on a large screen, 1600–2000 pixels wide is usually plenty. Beyond that you are paying real download time for a difference nobody can see.

Pick the format by what the image is

AVIF compresses better still, but desktop and tooling support lags, so use it only if you can serve a fallback with a <picture> element.

Quality: stop at 75–85%

Export defaults often sit at 95–100%, which costs a large share of the file for detail almost nobody can perceive. For web photographs, 75–85% is indistinguishable in normal viewing and commonly halves the file. Below 60% you start to see it in skies and skin.

If you have a specific page-weight budget in mind, the compress-to-a-size tool works backwards from the byte target rather than the quality number — set 150 KB and it finds the best quality that fits.

The two attributes that matter more than compression

These cost nothing and fix problems compression cannot:

Always set width and height on the tag. Without them the browser does not know how much space to reserve, so the page reflows when each image arrives — text jumps down the screen while someone is reading it. That is Cumulative Layout Shift, it is a ranking signal, and it is the most irritating thing a slow page does. The numbers do not have to match the display size; they establish the aspect ratio.

Use loading="lazy" on images below the fold — and only those. Deferring off-screen images is a clear win. Putting it on your hero image is a clear loss: it delays the one image the visitor is waiting for. A useful rule is that anything visible without scrolling should load eagerly.

A realistic before-and-after

A page with eight photographs straight from a camera:

That is a 97% reduction, and on a screen the two pages look identical. Almost all of it came from resizing and the format change rather than from the quality setting.

Things that quietly cost you

Related