Image Optimisation Fixes: Lighter, Sharper, Accessible Images
Images are often the heaviest part of a web page and, for shops and portfolios, the most important. A photo uploaded straight from a phone can weigh more than the rest of the page put together, and an image with no description is invisible to people using screen readers.
Our Image Optimisation audit looks at every image on the page: file size, format, dimensions, alt text, lazy-loading, contribution to layout shift and CDN delivery, and prioritises its recommendations by their effect on loading and bandwidth. This page explains each finding and links the guide that fixes it.
What makes an image heavier than it needs to be
Three separate decisions decide how many bytes an image costs, and the audit checks each of them. Getting any one wrong can make an image several times larger than necessary.
1. Pixel dimensions
If a photo is 4,000 pixels wide but displayed in a column 800 pixels wide, the browser downloads every
one of those extra pixels and then throws them away when it scales the image down. Phones make this worse,
because they need even fewer pixels for a small screen. The fix is to create several sizes of each image
and let the browser choose, using srcset and sizes. Allow for high-density
screens, which need roughly two times the display width to look sharp, but no more than that.
2. Format
JPEG and PNG are decades old. WebP and AVIF compress the same picture into noticeably smaller files, and both are supported by all current major browsers. PNG remains the right choice for a few cases, such as screenshots with sharp text where you need exact pixels, and SVG is best for logos and icons drawn as shapes.
3. Compression level
Every lossy format has a quality setting. Most photos can be compressed well below their camera or export default with no difference a visitor would notice. Tools such as Squoosh let you compare the original and the compressed version side by side before you commit to a setting.
Beyond the bytes, the audit also checks how images are delivered: whether they come from a CDN close to the visitor, whether they are cached, and whether off-screen images wait until they are needed.
Choosing the right format
| Format | Best for | Watch out for |
|---|---|---|
| AVIF | Photos and complex images where the smallest file matters | Slower to encode; check your platform or build tool supports it |
| WebP | A reliable default for photos and graphics, including transparency | Slightly larger than AVIF at similar quality in many cases |
| JPEG | A fallback for photos where modern formats are not available | No transparency; artefacts at low quality settings |
| PNG | Screenshots, diagrams with fine text, images needing exact pixels | Very large for photographs |
| SVG | Logos, icons and simple illustrations | Not for photos; clean up exported files, which often contain editor junk |
| GIF | Very little today | Animated GIFs are huge; a short muted video is usually far smaller |
You do not need to choose just one. The <picture> element lets you offer AVIF first,
WebP second and JPEG as a fallback, and each browser takes the first format it supports. Many CDNs and
platforms do this automatically, detecting what the browser accepts and converting on the fly, which
is often simpler than managing several files yourself.
Whatever format you use, keep sensible file names and alt text. Search engines use the file name, surrounding text and alt text to understand what an image shows, which matters for image search and for product listings.
Loading images in the right order
How an image is loaded matters as much as how big it is. The aim is simple: images the visitor sees first should load first, and images further down should wait.
- Lazy-load below the fold. Adding
loading="lazy"to images that start off-screen means the browser fetches them only as the visitor scrolls near them. On long pages this saves a lot of data. - Never lazy-load the main image. The hero image or first product photo is often the page's Largest Contentful Paint element. Lazy-loading it makes the browser wait until layout is complete before even requesting it, which delays the moment the page looks ready.
- Prioritise the main image. Adding
fetchpriority="high"to that one image tells the browser to request it ahead of less important files. - Make it discoverable. An image set as a CSS background, or inserted by JavaScript,
cannot be found until those files are processed. Use a normal
<img>in the HTML for important images, or preload them. - Reserve the space. Give every image
widthandheightattributes, or a CSSaspect-ratio, so the page does not jump when it arrives.
Alt text: describing images that matter
The alt attribute provides a text alternative for people who cannot see the image, including
screen reader users and anyone whose images failed to load. It is required by accessibility guidelines
for images that convey information, and search engines use it to understand image content.
The key question for every image is: what would a visitor lose if this image were missing?
- If it carries information, describe that information briefly. A product photo might need the product name and the variant shown; a chart needs its key finding, with the full data available elsewhere on the page.
- If it is a link or button, describe where it goes or what it does, not what it looks like.
- If it is purely decorative, such as a background texture, divider or an icon next
to text that already says the same thing, use an empty
alt=""so screen readers skip it. Leaving the attribute out entirely is different: some screen readers then read the file name aloud. - If it contains text, the alt text should include that text. Better still, use real HTML text instead of a picture of words.
Avoid starting with "image of" or "picture of", since screen readers already announce it as an image, and do not stuff alt text with keywords. Automatically generated descriptions can be a useful starting point, but they often miss what matters in context, so review them.
The fix guides
Each guide covers one audit finding, with examples and tool suggestions.
Bytes and formats
Fixing oversized image files covers
compressing to a sensible quality with Squoosh, ImageOptim or server-side tools such as Sharp and ImageMagick.
Fixing the wrong image format covers
serving AVIF and WebP with the <picture> element and a fallback. Fixing
wrong image dimensions covers generating responsive sizes with srcset and sizes,
at build time or through an image service.
Loading and stability
Fixing lazy-loading covers adding
loading="lazy" below the fold, removing it from the main image and using fetchpriority="high".
Fixing layout shift from images covers
width and height attributes, aspect-ratio and placeholders. Fixing
image CDN delivery compares options such as Cloudflare Images, BunnyCDN, Imgix and Cloudinary, and
the trade-off between cost and convenience.
Accessibility
Fixing missing or weak alt text covers writing useful descriptions, with good and bad examples, and the limits of automatic tools. Fixing decorative vs content image confusion covers when to use empty alt text or CSS backgrounds and when an image needs a real description.
By platform
WordPress covers optimisation
plugins such as ShortPixel, EWWW and Smush, responsive sizes and modern format support. Shopify
covers theme image tags, the Shopify CDN's resizing and format handling, and product variant images.
Next.js covers the Image component,
marking the main image as a priority, the sizes prop and enabling AVIF alongside WebP.
Which findings to fix first
- The main image on key pages. Make sure it is not lazy-loaded, is marked high priority, is sized for its slot and uses a modern format. This one image often decides how fast the page feels.
- Very large files anywhere above the fold. A single oversized banner or slider image can cost more than everything else on the page.
- Missing alt text on content images. Product photos, charts and images used as links without descriptions exclude screen reader users and give search engines nothing to work with.
- Images causing layout shift. Adding dimensions is quick, and the effect on stability is immediate.
- Format and dimensions across the site. Best solved once, with a plugin, platform setting, CDN or build step, rather than image by image.
- Lazy-loading lower down and CDN delivery. Worth doing, especially on long pages and for visitors far from your server.
Order of work
- Audit key templates. Run the Image Optimisation audit on your home page and main product, category, service and article templates.
- Fix the main image first, on each template: loading attributes, size, format and dimensions.
- Set up automatic handling. Choose a plugin, platform setting, CDN or build step that resizes, converts and compresses new images automatically.
- Reprocess existing images. Run bulk optimisation on the media library, starting with the most visited pages.
- Add dimensions and lazy-loading in the templates that output images.
- Write alt text, starting with product images, charts and linked images, and set decorative images to empty alt.
- Re-run the audit and compare total image weight and the timing of the main content.
For background, read the Image Optimisation Guide or follow the beginner tutorial. For how images fit into overall load speed, see the Page Speed Guide, and for the loading metrics themselves, the Core Web Vitals Guide.
1. Should I use WebP or AVIF?
Both are supported by all current major browsers and both are much smaller than JPEG and PNG. AVIF usually produces smaller files for photographs at similar quality, but it takes longer to encode and not every tool or platform supports it yet. WebP is a dependable default that almost every system can produce. If your CDN or platform can serve AVIF with WebP as a fallback, use both; otherwise WebP alone is a large improvement over older formats.
2. What size should my images be?
Size images for the space they are displayed in, not for the original photo. Work out the widest the image is ever shown on your layout, allow roughly double that for high-density screens, and create smaller versions for phones and narrow columns using srcset. Then compress each version as far as you can without visible loss. There is no single correct file size, but the audit flags images that are clearly larger than their display needs.
3. Should I lazy-load all images?
No. Lazy-load images that start below the visible part of the page, so they download only when the visitor scrolls near them. Do not lazy-load the main image at the top of the page, or anything visible on first load, because it delays the moment the page looks ready and can hurt Largest Contentful Paint. Many themes and plugins lazy-load everything by default, so check your hero and first product images and exclude them.
4. Does alt text help SEO?
Yes, as part of a wider picture. Search engines use alt text, together with the file name, caption and surrounding text, to understand what an image shows, which helps it appear in image search and supports the relevance of the page. Its main purpose, though, is accessibility for people who cannot see the image. Write alt text for them: describe what matters in context, briefly and accurately, without stuffing in keywords. That also tends to serve search engines well.
5. What should alt text say for a decorative image?
Nothing. Use an empty alt attribute, written as alt with an empty value, so screen readers skip the image entirely. Decorative images include background textures, dividers, and icons placed beside text that already says the same thing. Do not remove the attribute altogether, because some screen readers will then read out the file name instead. If an image is purely decorative, you might also consider applying it as a CSS background rather than an image element.
6. Do I need an image CDN?
Not always, but it often helps. An image CDN stores copies of your images on servers near your visitors and many can resize, convert and compress images automatically based on the device and browser. That removes a lot of manual work and can speed up delivery. A small site on good UK hosting serving mainly UK visitors may see a smaller gain. Many platforms, such as Shopify, already serve images through a CDN, so check before adding another.
7. Why do my images look blurry after optimisation?
Usually one of three reasons: the compression quality is set too low, the image is displayed larger than the version served, or it was re-compressed from an already compressed copy. Raise the quality setting slightly and compare side by side, make sure your srcset includes versions large enough for high-density screens, and convert from the original high-quality file. Screenshots and graphics with sharp text may need PNG or a lossless setting to stay crisp.
The Image Optimisation audit checks every image on your page for file size, format, dimensions, alt text, lazy-loading, layout shift and CDN delivery, and ranks its recommendations by their effect on loading and bandwidth.
Run the Image Optimisation Audit โ