Imagery
Images either carry information or they do not, and the ones that do not are costing you load time.
Definition
Imagery covers photography, illustration and other visual media. The first question for any image is whether it informs, and the second is what it costs in bytes, layout stability and accessibility obligation.
Craft convention. True because the industry converged on it. Breaking it costs familiarity, not correctness.
On this plate
Reach for this when
- Deciding whether a page needs an image.
- Optimising Core Web Vitals.
- Writing alt text.
- A page's weight or layout stability is dominated by its images.
Common mistakes
- Images without reserved dimensions.
- Lazy loading the hero image, which delays LCP.
- Alt text that repeats an adjacent caption.
Images that earn their place
- Product photography, where the user is deciding whether to buy and needs to see the thing.
- Screenshots and demonstrations, which show what the product does faster than prose.
- Diagrams that make a relationship visible.
- Portraits of real people in testimonials, where identity is part of the evidence.
- Illustration that carries a concept the copy cannot, rather than filling space.
Technical requirements
| Concern | Requirement |
|---|---|
| Layout stability | Set width and height, or aspect-ratio, so the space is reserved. Unreserved images are the main cause of CLS. |
| Format | AVIF or WebP with a fallback. SVG for diagrams and logos. |
| Responsive delivery | srcset and sizes so devices download appropriate resolutions. |
| Loading | Eager with fetchpriority high for the largest above-the-fold image; lazy for everything below. |
| Alt text | Descriptive for informative images, empty alt for decorative ones. Never omit the attribute. |
| Dark mode | Provide variants for images with baked-in light backgrounds. |
Images that earn their bytes
Do
- Serve modern formats with a fallback, and size the file to the slot it fills.
- Give every image explicit dimensions or an aspect ratio, so nothing shifts on load.
- Write alt text that carries the information the image carries, and nothing more.
- Mark decorative images as decorative rather than describing them.
Do not
- Ship a 2400 pixel hero to a 390 pixel phone.
- Use stock photography of nobody in particular to fill space.
- Put essential text inside an image, where it cannot be selected, translated or resized.
- Lazy load the image at the top of the page, which delays the thing the reader came for.
In practice
- i.
Stock photography of nobody in particular
MarketingGeneric images of people at laptops carry no information and cost load time and layout stability. Removing them usually improves the page. A screenshot of the actual product almost always outperforms them.
- ii.
Text baked into a picture
What it costsA pricing table shipped as an image could not be translated, searched, selected, read aloud or zoomed without blurring. Every one of those was a requirement somewhere, and none of them was visible in the design review.
Local chart
FND·051 · Region II · Grid D2
This entry and the entries it is stated to connect with. Each line is labelled with what the connection means.
Sources
Where a source establishes something narrower than the popular reading of it, the note says so.
- [1]
web.dev, Google
Continue from here
Each link says what the connection is, so you can tell a principle from an alternative from a thing people mix this up with.
Applies when you are designing
Applied through
Where this shows up as a concrete interface decision.
- AvatarCMP·024 · Component
- CarouselCMP·027 · Component
- Loading StatesPAT·011 · Pattern
- Skeleton ScreensPAT·012 · Pattern
Principles behind this
The reasoning this solution is an application of.
- Banner BlindnessPSY·003 · Psychology
Short definition
The one-paragraph version, for when that is all you need.
- Alt TextTERM·080 · Term
- Core Web VitalsTERM·123 · Term
- Cumulative Layout ShiftTERM·124 · Term
- Largest Contentful PaintTERM·125 · Term
- Lazy LoadingTERM·128 · Term
Related concept
Connected closely enough to change how you apply this.
- Alt TextA11Y·007 · Accessibility
- Dark ModeFND·027 · UI foundation
- Performance as User ExperienceFND·054 · UI foundation
- ProportionFND·013 · UI foundation
- Responsive LayoutFND·043 · UI foundation