
Website images that don't slow you down: size, format and lazy-loading
"My photos look great, but the site feels heavy." This article looks at images only: how big they should be, which format to use, and which images you should never lazy-load. If you can pass these points to whoever looks after your site, you will have covered the image basics.
Start with the one image that matters most
A page's main image is the largest one visitors see without scrolling. It might be a hero photo on your home page, or the product shot on a product page. Largest contentful paint (LCP) is the moment the biggest visible element appears.
The guidance from web.dev is blunt: never lazy-load that image. In their words, "Never lazy-load your LCP image, as that will always lead to unnecessary resource load delay." Lazy-loading tells the browser to wait before fetching an image. That is helpful for pictures far down the page. For the main image, lazy-loading delays its request and slows the page (web.dev).
What lazy-loading is for
Lazy-loading means an image is fetched only when the visitor is about to scroll to it. The rule is easy to remember: use it only for images outside the first screen. As web.dev puts it, "Use loading=lazy only for images outside the initial viewport." Images that are visible when the page opens should keep the default, eager loading.
Check that the image at the top is not set to lazy-load, including any setting your theme or plugin controls.
Help the browser find the main image early
Two further points come from the same guidance:
- Put the key image in the page itself. It should be a normal image tag in the page's HTML, not something added later by JavaScript or set only as a CSS background. When it is in the HTML, the browser finds it early and starts downloading it sooner.
- Mark the most important images as high priority. Adding fetchpriority="high" to the one or two most important images tells the browser to fetch them first, so they load sooner.
You do not need to understand the code. You need to know to ask: "Is our main image in the HTML, and is it set to high priority?"
Stop the page jumping around
Setting a width and height on every image tag lets the browser reserve space before the image arrives, so the page does not jump as images load.
Send the right size to the right screen
A photo that is 3,000 pixels wide looks lovely, but a phone does not need that much detail, and downloading it wastes time and data. This is where srcset comes in. It lets you offer the browser several sizes of the same image, and the browser picks the best one for the visitor's screen. Phones are not forced to download desktop-size files.
There is one catch worth knowing. A screen can be "2x", meaning it packs twice as many pixels into the same space. A 400-pixel image looks soft on a 2x screen, which needs about 800 pixels. So do not shrink images blindly. Offer a sensible range of sizes and let the browser choose.
Choosing a format: JPEG, WebP or AVIF
The same photo can be saved in several formats, and some produce much smaller files than others. AVIF can give much smaller files than JPEG or WebP.
The trade-off is support. AVIF is newer: Chrome supports it from 2020, Firefox from 2021 and Safari from 2022. A browser that does not support a format cannot show the image at all, so you need a fallback. In practice that means offering AVIF first, with WebP or JPEG behind it, so every visitor sees a picture. If your site is built on WordPress or an e-commerce platform, check whether it does this for you or whether an image setting needs switching on.
Compression: small, but still good-looking
Compression reduces file size by discarding some detail. The aim is the smallest file that still looks right to you, so compare the result with the original at the size it will actually be shown.
A simple checklist
Here is what to ask for, in order:
- 1The main image is not lazy-loaded.
- 2The main image is in the page's HTML and set to high priority.
- 3Images further down the page are lazy-loaded.
- 4Every image has a width and height set.
- 5Several sizes are offered through srcset, so phones get smaller files.
- 6A modern format such as AVIF or WebP is used, with a fallback.
- 7Files are compressed until they are small but still look right.
What to expect
We cannot promise a particular result for your site.
If your site feels heavy and you would like someone to look at it properly, get in touch through our contact page and we will take a look at what is slowing it down.
Continue Reading
Discover more insights and stories


