
Publish useful, accessible and lightweight web images
A strong image shows or explains something the text cannot convey as well alone. Relevance, rights, format, file size and the way the image is presented to people and search systems all matter.
What to remember.
- Give every important page a representative image with a clear purpose.
- Deliver suitable sizes in HTML and describe meaningful images in context.
- Record rights and check mobile crops, file weight and missing assets before release.
Choose the image for its role
A primary image should represent its page; a card image should help people recognise the destination; a screenshot should show the actual step being explained. Avoid generic visuals interchangeable across unrelated topics. Closely related pages deserve distinct primary images. Size variants of one asset serve different screens on the same page, while mobile crops must preserve the important subject.
Prepare files for their display size
Export dimensions close to the intended display and provide a smaller version for narrow screens. Compare the result at its real size before reducing quality further. WebP and AVIF can reduce transfer, but choose by visual quality and the compatibility needed. Give files short descriptive names. Keep subject, author or licence, review date and restrictions in an editorial asset register. Embedded metadata can help asset management but may be stripped in processing.
Make images discoverable without slowing the page
Put important images in an img element, optionally inside picture, with a fallback src URL. Search engines do not treat CSS background images in the same way. Declare width and height to reserve space. Prioritise a main image visible at the top of the page; defer images lower down. Confirm the intended mobile file is served and remains legible. An image sitemap can help discovery but cannot replace useful page content.
Write alternative text for the actual context
Alternative text communicates the useful information conveyed by an image; it is not a list of keywords. Describe an editorial image briefly in relation to the page. When an image is a link, communicate its destination if adjacent text does not already do so. A purely decorative image can have empty alternative text. Put the image near relevant copy and use a caption when source, method or context needs more room.
Check provenance and permission
Before publishing, identify the source, rights holder and permitted uses. Being discoverable online does not grant permission to reuse a picture. Review applicable consent for identifiable people and show required credits where readers can find them. For a third-party logo, prefer an official asset and verify it represents the named organisation. Never pass a neutral badge off as an official mark.
Review rendering and maintenance
Open key pages on large and small screens, checking heroes, lists and cards. Find missing files, misleading crops, unjustified duplicates and absent alternatives. Check dimensions, transferred weight and layout movement. After publication, relate image and page performance to the purpose of the page: an indexed image without useful visits, or a fast page with a misleading visual, is not a complete success.
Check the reference material.
Related guides
Four decisions for a useful image
- PurposeInformation, illustration or decoration
- DimensionsDelivered size suited to the screen
- CompressionReduced bytes and compared appearance
- IntegrationAlternative, dimensions and loading
Check the file the browser actually selects
An image can have several source files while still downloading an unnecessarily large one. In browser developer tools, compare the selected image URL (currentSrc), its pixel dimensions, the displayed width and the device pixel ratio. Repeat at a narrow and a wide viewport with the cache disabled.
| Observation | What to inspect |
|---|---|
| A small card downloads the largest image | Check whether sizes describes the card width at each breakpoint. Width descriptors in srcset must match the actual files, rather than their intended CSS width. |
| The text jumps when an image appears | Compare width and height with the file ratio. If a thumbnail deliberately uses a different crop, reserve that ratio in CSS and check object-fit and object-position. |
| Two large images download for one visible slot | Compare any preload with the image’s srcset and sizes. A mismatched preload can request a file that the responsive selection does not use. |
web.dev: serve responsive images · Reserve image space to reduce layout shifts
Image alternatives and context: W3C WAI · Images.
Reduce bytes without losing useful information
Fictional teaching example, not a client result or a market benchmark.
A page shows three photographs. The team prepares suitable dimensions and compares variants visually. File sizes are fictional decimal kilobytes; they do not predict load time.
On a small screen, scroll horizontally to read every column. You can focus the table area and use the left and right arrow keys.
| Image | Before | After |
|---|---|---|
| Main photograph | 900 kB | 150 kB |
| Detail photograph | 450 kB | 80 kB |
| Context photograph | 350 kB | 70 kB |
| Total for three photographs | 1,700 kB | 300 kB |
The reduction is (1,700 − 300) ÷ 1,700 × 100, or about 82.4%. This covers the example files and excludes fonts, scripts and other resources. A smaller file alone does not guarantee a fast page.
Check the file actually received on mobile, crop and sharpness. A small image enlarged excessively may become unreadable; a large file delivered to a small screen wastes bytes.
Reserve image dimensions to limit layout shifts. Make the immediately visible main image available without lazy-loading delay; illustrations further down can load as they approach the viewport.
What to record before deciding
Record dimensions, file size, format, placement, the mobile-delivered file and visual check. Give informative images a contextual alternative that conveys their information.
Put the method into practice
An illustrative application case
A context photograph appears to depict a client. Replace the ambiguous caption with a factual subject description and credit. Check permission, delivered variants and alternative text. An attractive image should not add a claim the content cannot substantiate.
Build a useful, maintainable design system
Use this worksheet in a review with the person responsible for delivery. Keep the evidence alongside the decision, rather than marking a task complete on trust alone.
| Action | Evidence |
|---|---|
| Choose an informative image and verify usage rights. | A source, permission or licence and a caption without invented identity. |
| Compare format, compression and dimensions at the useful display size. | Appropriate variants without visible loss of essential information. |
| Check HTML dimensions, alternative text and primary-image loading. | A mobile test where the image does not shift text or arrive unnecessarily late. |
A question to resolve before acting
Does every image need lengthy alternative text?
No. Decorative images can use alt="". Informative images should convey useful information in context; a complex chart often needs an explanation or table in the surrounding content.