Photography and Imagery · Step 7 · 4 min read
Images and page speed
Images are usually the biggest thing on a page and the slowest to arrive. What LCP and CLS measure, why the hero photo decides them, and four habits that make pages faster: dimensions, eager heroes, lazy everything else, and fetchpriority.
On most pages, the hero photo is the page's speed. When people say a page "loaded", they usually mean the big thing at the top appeared. On most mobile pages that big thing is an image. So the way you choose, size and load that one photo decides how fast the product feels, and slow costs real money.
What you'll be able to do after reading:
- Explain LCP and CLS, and how images affect both
- Stop images from making the page jump
- Know which images to load first and which to load later
- Ask for the right attributes in a handoff
1. Why it matters
- Images are the largest thing on most pages. The HTTP Archive's Web Almanac found that on 73% of mobile pages the largest element on screen, the one that sets LCP, is an image (Web Almanac 2024, Performance).
- Speed sells. In an A/B test, Vodafone found that a 31% improvement in LCP led to 8% more sales (web.dev, Vodafone case study, 2021).
2. Two numbers to know
Google's Core Web Vitals give three numbers for how a page feels; two are mostly about images (web.dev, Web Vitals):
- LCP, Largest Contentful Paint: how long until the biggest thing on screen appears. Good is 2.5 seconds or less.
- CLS, Cumulative Layout Shift: how much the page jumps while it loads. Good is 0.1 or less.
Both are measured on real visits, at the 75th percentile: three out of four visits should be good.
3. Stop the jump
No size, loaded: the text jumps down
Width and height, loaded: nothing movesThe most common cause of a poor CLS is images without dimensions (web.dev, Optimize CLS). The fix is one line: give every image its width and height, or an aspect-ratio in CSS, so the browser keeps the space before the file arrives.
<img src="bread-960.jpg" width="960" height="640" alt="…">
With CSS width: 100%; height: auto; the image still scales; the two numbers only tell the browser its shape.
4. Load the right images first
- The hero loads first. Never lazy-load the LCP image; it always delays it (web.dev, Optimize LCP). Yet the Web Almanac found 16% of mobile pages with an image LCP lazy-loading it.
- Tell the browser it's important.
fetchpriority="high"on the hero moves it to the front of the queue (web.dev, Fetch Priority). Its use on LCP images jumped from almost nothing in 2022 to 15% of mobile sites in 2024 (Web Almanac 2024). - Everything below waits.
loading="lazy"on images outside the first screen makes the browser fetch them only as people scroll (web.dev, Lazy loading).
<img src="hero.jpg" width="1600" height="900" fetchpriority="high" alt="…"> <!-- the first screen -->
<img src="card.jpg" width="480" height="320" loading="lazy" alt="…"> <!-- further down -->
5. What design changes
Code helps, but the biggest wins are design decisions:
- Fewer, better images. Every photo that does no job (see The photos nobody looks at) is weight for nothing.
- A hero that's a photo, not a slideshow. A carousel loads several large images for one that's seen.
- Real text, not text in images. Text loads instantly; an image of text is a heavy, blurry file.
- The right file for each screen (see Responsive images and art direction).
6. Common mistakes
- Images without width and height.
loading="lazy"on every image, including the hero.- A hero carousel of five full-size photos.
- A 4000 pixel photo shown 400 pixels wide.
- Checking speed only on office wifi and a new laptop.
7. Vocabulary
| Term | Meaning |
|---|---|
| LCP | Largest Contentful Paint: when the biggest element on screen appears |
| CLS | Cumulative Layout Shift: how much the page jumps while loading |
| Lazy loading | Fetching an image only when it's about to scroll into view |
| fetchpriority | An attribute that tells the browser how urgent a resource is |
| 75th percentile | The value three out of four visits are at or better than |
8. Try it (one free tool)
- Open a page you designed in Chrome, then DevTools, then the Lighthouse tab, and run it on mobile.
- Find the LCP element. Is it an image?
- Look for layout shifts caused by images.
Reflection questions: Which image decided your LCP? What design change, not code change, would make it faster?
9. If you already practise
- Mark the LCP image in every page design, so it gets
fetchpriority="high"and neverloading="lazy". - Put width and height, or the aspect ratio, in every image spec.
- Track LCP and CLS from real visits, not just lab tests, and review them with the team.
Checklist
Learn more
- HTTP Archive, Web Almanac 2024, Performance
- web.dev: Web Vitals · Optimize LCP · Optimize CLS · Lazy loading · Fetch Priority · Vodafone case study
Books, courses and videos to go deeper
Book links go to Amazon. As an Amazon Associate I earn from qualifying purchases, at no extra cost to you.
Related
Responsive images and art direction · Formats and compression · The photos nobody looks at · Responsive image checklist