Open the network tab on almost any slow website and you’ll find the same culprit. Not the JavaScript framework. Not the analytics scripts. Images. On a typical page, images account for roughly half the total page weight — and on marketing sites with big hero visuals, it’s often 70% or more. One unoptimised 4MB hero image does more damage to your load time than every other asset on the page combined.
This matters more than it used to. Google’s Core Web Vitals are a ranking factor, and the metric most sites fail — Largest Contentful Paint (LCP) — is, on most pages, an image. If your hero image loads slowly, your LCP is slow, your rankings suffer, and your visitors leave. Research has shown for years that users expect pages to load in about two seconds; every additional second measurably increases bounce rate.
The good news: image optimisation is the highest-leverage performance work you can do, and most of it is mechanical. Right format, right size, right loading strategy, right delivery. This is the full playbook, in the order we apply it.
Start With Format: WebP and AVIF Are the Default Now
For years, the format decision was JPEG for photos, PNG for graphics, GIF for animation. That guidance is out of date. In 2026, every major browser supports WebP and AVIF, and they should be your defaults.
WebP compresses 25–35% smaller than an equivalent-quality JPEG, supports transparency (smaller than PNG), and supports animation (dramatically smaller than GIF). It has been safe to use everywhere for years.
AVIF goes further — typically about 50% smaller than JPEG at comparable visual quality, with better handling of gradients, film grain, and HDR colour. It’s now supported across Chrome, Firefox, Safari, and Edge. The trade-off is slower encoding, which matters for build pipelines processing thousands of images, but not for a typical website.
What the legacy formats are still for:
- JPEG: the universal fallback for photographs. Still fine; no longer first choice.
- PNG: lossless graphics and screenshots where every pixel matters. For logos and icons, SVG almost always beats it — infinitely scalable, tiny, and sharp on every screen.
- GIF: honestly, almost nothing. An animated GIF is routinely 5–10x the size of the same clip as a muted, looping MP4 or an animated WebP. If you’re shipping GIFs in 2026, that’s your quickest win.
The practical implementation is the <picture> element: offer AVIF first, WebP second, JPEG as the fallback. The browser picks the best format it supports, older browsers degrade gracefully, and nobody gets a broken image. Most modern frameworks and CMS image pipelines — Next.js, Astro, WordPress with a decent optimisation plugin — will generate these variants automatically. If yours doesn’t, that’s a configuration problem worth an afternoon.
Compress Harder Than Feels Comfortable
Format is half the equation. Compression level is the other half, and most teams are far too cautious with it.
Lossy compression at quality 75–85 is visually indistinguishable from quality 100 for almost every photograph on almost every screen — and it’s often a third of the file size. Nobody is inspecting your hero image at 400% zoom. They’re glancing at it for two seconds on a phone.
What works:
- Set quality to 80 as your default for photographic content, and only raise it when you can actually see a difference at normal viewing size.
- Strip metadata. Camera EXIF data, colour profiles, and GPS coordinates can add tens of kilobytes per image and serve no purpose in a browser.
- Automate it. Squoosh is excellent for one-off comparisons, and tools like TinyPNG or ImageOptim work for small batches. But manual compression doesn’t survive contact with a real team — someone will always upload a 6MB photo straight from their phone. Compression must happen automatically at upload or at build time, not as a human step.
A concrete before-and-after we see constantly: a 3.5MB camera-original JPEG, resized to its actual display width and re-encoded as AVIF at quality 75, lands around 80–120KB. That’s a 95%+ reduction with no visible quality loss. Multiply that across a page with ten images and you’ve removed 30MB of transfer.
Size Images for the Screen That’s Actually Viewing Them
Sending a 2400px-wide image to a 360px-wide phone screen wastes 90% of the bytes transferred. This is the single most common image mistake we find in audits — the format is fine, the compression is fine, but every visitor gets the desktop-retina version regardless of device.
The fix is responsive images with srcset and sizes. You generate the image at several widths — say 480, 800, 1200, and 2000 pixels — list them in the srcset attribute, and tell the browser via sizes how large the image will render. The browser then downloads only the version it needs, factoring in both viewport width and pixel density.
Two details teams get wrong:
- The
sizesattribute matters as much assrcset. Without it, the browser assumes the image spans the full viewport and over-downloads. If your image sits in a 600px column, say so. - High-DPI screens are handled for free. A retina display with a device pixel ratio of 2 will automatically select the larger variant from your
srcset. You don’t need separate “@2x” logic — you need enough width variants in the set.
Generating four or five sizes per image sounds tedious, and it is — which is why it should never be manual. Every serious image pipeline, from framework image components to CDN-based resizing, does this automatically. Your job is to make sure it’s switched on and the sizes hints are accurate.
Lazy Load Everything Below the Fold — and Nothing Above It
Lazy loading defers image downloads until the user scrolls near them. A page with thirty images might only need four to render the initial view; loading the other twenty-six upfront wastes bandwidth and competes with the assets that actually matter for first paint.
The implementation used to require a JavaScript library. It no longer does. Native lazy loading — loading="lazy" on the img tag — is supported in every modern browser and needs zero dependencies.
The rules are simple:
- Below the fold: add
loading="lazy". Galleries, footers, long article bodies — all of it. - Above the fold: never lazy load. This is the mistake that quietly wrecks LCP scores. Lazy loading your hero image tells the browser to deprioritise the most important asset on the page. Instead, do the opposite — mark it with
fetchpriority="high"and preload it so the browser starts fetching it before it has even finished parsing your CSS. - Always set width and height attributes (or CSS
aspect-ratio) so the browser reserves space before the image arrives. Skipping this causes layout shift as images pop in — which damages your Cumulative Layout Shift score and makes the page feel broken while it loads.
We regularly see sites where the only change needed to pass Core Web Vitals was removing loading="lazy" from the hero image and adding a preload hint. One attribute, measurable ranking impact.
Deliver Through a CDN, Cache Aggressively
Where an image is served from matters almost as much as how big it is. A visitor in Singapore pulling images from a server in Frankfurt pays a latency tax on every single request. A content delivery network removes it by serving images from an edge location near the visitor.
Modern image CDNs — Cloudflare Images, Cloudinary, imgix, Bunny, or the built-in pipelines on Vercel and Netlify — do far more than geographic distribution. They handle format negotiation (serving AVIF to browsers that support it, JPEG to those that don’t), on-the-fly resizing from a single master image, and compression, all from URL parameters. That collapses most of this article into infrastructure you configure once.
On caching: images are the most cacheable asset you have. Set long cache lifetimes — a year is standard — with fingerprinted or versioned filenames so updates bust the cache cleanly. A returning visitor should download almost nothing. There is no reason your logo should ever be fetched twice by the same browser.
The SEO Layer: Alt Text and File Names
Image SEO is unglamorous and takes minutes, so most sites skip it and leave traffic on the table.
Alt text does two jobs: it makes images accessible to screen reader users, and it tells search engines what the image shows. Write a plain, specific description — “founder presenting quarterly roadmap on office whiteboard,” not “image1” and not a keyword list. Keyword-stuffed alt text reads as spam to both users and crawlers.
File names are a weaker but free signal. Use descriptive, hyphen-separated names: walnut-standing-desk-oak-finish.jpg beats DSC_04231.jpg. Hyphens, not underscores — search engines read hyphens as word separators.
If your pages get shared, set Open Graph and Twitter Card images too (1200×630 is the safe dimension). A link with a proper preview image gets meaningfully more clicks than a bare URL, and it takes two meta tags to fix.
Measure Before, Measure After
Optimisation without measurement is guesswork. The loop is short:
- Baseline first. Run the page through PageSpeed Insights or WebPageTest before changing anything. Record LCP, total page weight, and image weight specifically.
- Fix in order of impact. The LCP image first, then everything above the fold, then the long tail below it. One hero image done properly usually beats fifty thumbnails done properly.
- Re-test on a real mobile connection, not your office wifi. Field data in PageSpeed Insights tells you what actual visitors experience; lab scores are only a proxy.
- Watch for regression. The most common failure isn’t bad optimisation — it’s good optimisation slowly undone by six months of uncompressed uploads. Automated pipelines prevent this; quarterly manual audits merely document it.
Realistic expectations: on a typical unoptimised marketing site, this playbook cuts image weight by 60–80% and improves LCP by one to three seconds. That’s usually the difference between failing and passing Core Web Vitals — and between a visitor who stays and one who’s already gone.
The Bottom Line
Image optimisation isn’t one technique — it’s a short pipeline. Modern formats (AVIF, WebP), honest compression, responsive sizes via srcset, native lazy loading below the fold, priority loading above it, CDN delivery, and long cache lifetimes. None of it is difficult. All of it compounds.
The real decision is whether it happens automatically. Manual optimisation decays the moment someone uploads a phone photo into the CMS. Build it into your pipeline once — at upload, at build, or at the CDN — and every image on the site is fast forever, without anyone thinking about it again.
Your images are half your page weight. Optimise them, and you’ve optimised half your website.
Bojan Zlatanović
Founder at Norvaris. Building digital products and writing about what actually works in product, engineering, and growth.
More from this author