Image optimisation for websites: WebP, AVIF, lazy loading and alt text
Images are usually the heaviest part of a web page. Learn how to shrink them without losing quality, speed up loading and help them appear in Google Images.
Photos sell, but they often slow sites down too. An image straight from a camera can weigh several megabytes – more than the rest of the page combined. Image optimisation is one of the fastest ways to improve your Core Web Vitals.
Formats
| Format | Use |
|---|---|
| WebP | photos and graphics – much smaller than JPEG/PNG, supported by all modern browsers |
| AVIF | even better compression, especially for photos; provide a WebP or JPEG fallback |
| SVG | logos, icons and vector illustrations – sharp at any size |
| JPEG / PNG | fallbacks and images shared on social media |
The right size
Do not send a 4,000 px image to an 800 px column. Prepare several variants and let the browser choose:
<img src="photo-800.webp"
srcset="photo-480.webp 480w, photo-800.webp 800w, photo-1280.webp 1280w"
sizes="(max-width: 700px) 100vw, 800px"
width="1280" height="720" alt="A description of what the photo shows">
The images on this site are prepared exactly this way – each has three WebP sizes and a separate JPEG for social sharing.
Loading
- Lazy loading –
loading="lazy"for images below the first screen. - No lazy loading for the main image – the image visible straight away (often the LCP element) should load immediately; you can add
fetchpriority="high". - Dimensions –
widthandheightattributes reserve space and prevent layout shift (CLS). - Caching – images rarely change, so browsers can cache them for a long time.
Image SEO
- Alt text – a specific description of what the image shows and why it is there, without keyword stuffing. Purely decorative images get an empty
alt="". - File names – descriptive (
online-store-cart.webp) rather thanIMG_4521.jpg. - Context – place images near related text, with a caption where useful.
- Sitemap – important images can be listed in your XML sitemap.
- Structured data – include the image in article or product markup.
- Sharing image – an
og:imagetag at about 1200×630 px.
Checklist
- WebP or AVIF, with a fallback where needed.
- Several sizes with srcset/sizes.
- Width and height in the markup.
- Lazy loading below the fold, none for the main image.
- Descriptive alt text and file names.
- Rights to every photo – a licence or your own material.
We optimise images for new websites and as part of ongoing support. For the technical big picture, see our step-by-step SEO audit.
Frequently asked questions
Does WebP work in all browsers?
Yes, all modern browsers support WebP. AVIF is also widely supported, but it is worth providing a fallback format.
Does alt text affect SEO?
Yes. It helps search engines understand the image and is essential for accessibility. Describe the image naturally, without keyword stuffing.
Related services
- WebsitesOur websites are just that good! We stay ahead of the competition with innovative solutions and focus on truly high-quality projects.
- Search engine optimisationIn a relatively short time we can position your website so that it appears among the first results in search engines.
- Complete supportWe take care of your website! All changes and updates within as little as 24 hours. No more wasting time adding news, photos and descriptions.