Why images are the most common problem
A photo straight from a phone or camera is typically 4 to 8 MB and 4,000 pixels wide. On the website, however, it is displayed in a space 800 pixels wide. The visitor has to download several times more data than needed, and on a mobile connection the page crawls. On most slow websites I work on, images make up the largest part of the page weight.
What optimisation involves
- The right dimensions: the image is no larger than it will actually be displayed. WordPress can create several sizes and the browser picks the right one.
- Compression: a smaller file with no visible loss of quality.
- A modern format: WebP or AVIF are much smaller than JPG or PNG at the same quality.
- Lazy loading: images further down the page only load as you scroll.
- Specified dimensions in the code so the content does not jump around while loading.
- Description and file name: alt text and a name like "oak-wooden-bench.webp" instead of "IMG_2041.jpg" help in Google Images.
A real-world example
A wedding photographer in Košice had a gallery of twenty full-resolution photos on her home page. The page weighed over 60 MB and took tens of seconds to load on mobile. After resizing to sensible dimensions, converting to WebP and enabling lazy loading, the page dropped to a few MB. The photos looked exactly the same on screen. Her Core Web Vitals scores improved too.
Tips for online shops and websites
- Upload photos at least slightly reduced, for example to 2,000 pixels on the longer side.
- Use a plugin that resizes and converts images automatically on upload, including older images in the library.
- Watch out for the image at the top of the page. It should not be lazy loaded; it should load straight away.
- Icons and logos belong in SVG format.
Image optimisation is always part of the website speed optimisation service. Lightweight images with alt text also help SEO.