Website Image Optimization: The LCP-First Playbook
iLoveConverter Team 7 min read
On this page
Most pages are made of images before they are made of text. On a typical content page, image bytes account for well over half of the total payload, and the single largest image on screen is usually exactly what Google’s Largest Contentful Paint (LCP) metric measures. That makes image optimization the highest-leverage performance work on most sites: not server tuning, not framework cleverness — just shipping fewer, smarter bytes. This is the playbook we apply ourselves, in the order that matters.
Why LCP and the first screen decide everything
LCP measures when the largest visible element finishes painting — on content pages, almost always the hero image or banner. Google’s Core Web Vitals treat LCP under 2.5 seconds as good; treat that as the current documented threshold and check the official pages, because the tooling has refined these targets before. The first screen is special for a second reason: nothing below the fold affects what the user feels in the first seconds. Optimization effort should therefore split into two budgets — aggressive for the hero, pragmatic for everything else.
Format selection: WebP/AVIF first, JPG as the fallback
The format decision is the biggest single win, and it barely takes any work:
| Content | First choice | Fallback | Why |
|---|---|---|---|
| Photographs | WebP (or AVIF) | JPG | ~25–34% / 40–50% smaller than JPEG at equal quality |
| Screenshots, UI graphics | PNG or lossless WebP | PNG | Sharp edges survive lossless; lossy smears text |
| Logos, icons with transparency | WebP or PNG | PNG | Both carry alpha channels |
| Animation | WebP (animated) or GIF | GIF | Animated WebP is far lighter, when your pipeline supports it |
The numbers in the photo row come from our own comparisons — the full reasoning is in PNG vs WebP vs AVIF. Two honest caveats: AVIF compresses hardest but encodes slowly and still meets resistance in some upload pipelines, so WebP is the pragmatic default; and the fallback is not optional. Serve the JPG (or PNG) derivative alongside with a <picture> element so unknown consumers always have something they can decode. That costs one extra file per image and buys universal compatibility.
Compression levels: the settings that actually matter
- Quality 75–85 is the sweet spot for WebP photographs. Below ~60, blocking and banding appear in gradients and skin tones; above ~90, you pay real bytes for differences nobody can see.
- Always re-encode from the original. Converting an already-compressed JPG into a smaller WebP multiplies artifacts; a WebP made from a PNG master or camera original stays clean. Keep your masters.
- Use lossless only where it earns its size. For text-heavy screenshots, lossless WebP keeps every pixel and still beats PNG by 20–30%. For photos, lossless makes no sense.
- Don’t compress twice. Running a WebP through a compressor a second time buys almost nothing; if a file is still heavy, the problem is its dimensions or its source, not its quality setting.
Put the tiers in a small budget table and the decisions become mechanical:
| Role | Quality (WebP) | Target size | Notes |
|---|---|---|---|
| Hero / LCP image | 80–85 | ≤ ~150 KB | The one image worth hand-tuning |
| Content images | 75–80 | 50–150 KB | The bulk of the page |
| Thumbnails / previews | 70–75 | < 30 KB | Aggressive is invisible here |
The table is a starting point, not law — a dense infographic may need the hero budget while living in the content slot. What it buys you is speed: when every image has a slot and a budget, “is this page done?” stops being a matter of taste.
Sizing and lazy loading: the half that isn’t compression
- Export at display size. A 2400 px image shown in a 800 px slot wastes every byte beyond what a 1600 px retina version needs. Export for the box the image actually occupies, ×2 for retina, and let
srcsetserve the right one per device. - Lazy-load below the fold, and only below the fold. Native
loading="lazy"on everything the user must scroll to reach. Never on the LCP image — lazy-loading the hero delays exactly the metric you are optimizing. - Preload the hero.
<link rel="preload" as="image">(withfetchpriority="high") tells the browser to start the largest image first instead of discovering it after layout. - Give every image explicit dimensions so the layout doesn’t jump while loading — free CLS points, and zero bytes.
A conversion workflow with in-browser tools
- Audit first. Run Lighthouse (Chrome DevTools → Lighthouse) and note which image is the LCP element and its size. Expected result: a “Performance” score and an “Largest Contentful Paint element” entry naming your hero image.
- Convert photos to WebP. Open JPG to WebP, drop the hero and section images, download the results. Expected result: visually identical images roughly a quarter lighter. The conversion runs in your browser — no file touches a server.
- Shrink what’s still heavy. Run the WebP output through compress WebP, and produce lighter JPG fallbacks with compress JPG. Expected result: the hero image comfortably under your per-image budget (for most heroes, under ~150 KB).
- Wire the pair. Emit
<picture>markup: WebP first, JPG fallback, matching dimensions, explicit width/height,loading="lazy"everywhere except the hero. - Re-run Lighthouse. Expected result: a visibly lower LCP value — often by more than the bytes you removed, because the browser starts painting the smaller file sooner.
Pitfalls
- Compressing an already-compressed image. Artifacts stack. Keep originals; generate derivatives from them.
- Lazy-loading the hero. The single most common self-inflicted LCP wound. The below-fold rule has one exception, and it’s the image that matters most.
- AVIF with no fallback. Browsers handle it today, but upload pipelines, email clients and third-party tools may not. Pair it with WebP/JPG.
- Downscaling in CSS. An 800 px-wide slot fed a 3000 px file burns mobile data for nothing.
srcsetexists for this. - Lossy compression on interface graphics. Screenshots and logos need lossless (PNG or lossless WebP); the fuzzy-text look is lossy’s signature.
- Optimizing only the homepage. LCP is per-page; templates that share hero images are the easy wins, but every content image on every template eventually shows up in someone’s LCP.
FAQ
Is WebP really better than JPG?
At equal visual quality, a WebP photograph is typically 25–34% smaller than the JPEG equivalent — and it supports transparency and animation, which JPG does not. Modern browsers all render it. For web delivery there is no scenario left where JPG wins on a photo; its remaining role is compatibility fallback.
What quality setting should I use for WebP?
Start at 80 for photographs and adjust by eye: 75–85 is the range where files are small and artifacts stay invisible. Below 60 you start seeing blocking in gradients; above 90 you pay for nothing. Screenshots and UI graphics should use lossless instead.
Do I still need a JPG fallback in 2026?
For <picture> delivery, yes — it costs almost nothing and guarantees every consumer can decode something. AVIF still meets resistance outside browsers, and some pipelines (thumbnails, integrations, old tooling) expect JPG. Keep it as the safety net.
Why is my converted WebP almost as big as the JPG?
Because the source was already a compressed JPG. Each lossy generation adds artifacts and reduces what the encoder can still remove. Re-encode from the PNG master or camera original; the size difference is immediately visible.
Should I resize first or compress first?
Resize first. Dropping the pixels nobody displays is the largest lossless win; compressing a full-size image spends bytes on detail that gets thrown away anyway. Resize to the display box, then pick the quality setting — in that order, always from the original.
Does lazy loading slow down my LCP?
It does — if you apply it to the LCP element itself. Lazy-load everything below the fold; leave the hero image eager and preloaded. Done that way, lazy loading improves bandwidth usage on every page while leaving the first screen untouched.
Try it yourself — free, right in your browser
Everything mentioned in this guide runs locally on this site: no upload, no watermark, no sign-up.
Format deep-dives: JPG (.jpg.jpeg.jpe) , WebP (.webp) , PNG (.png) , AVIF (.avif)