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 page
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. |
In practice
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.
Sources
Where a source establishes something narrower than the popular reading of it, the note says so.
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.
- AvatarComponent
- CarouselComponent
- Loading StatesPattern
- Skeleton ScreensPattern
Short definition
The one-paragraph version, for when that is all you need.
Related concept
Connected closely enough to change how you apply this.
- Alt TextAccessibility
- Dark ModeUI foundation
- Performance as User ExperienceUI foundation
- ProportionUI foundation
- Responsive LayoutUI foundation