How to Fix Oversized Images and Cut Homepage Image Weight

Oversized images are files much heavier than they need to be, usually full-resolution camera or stock photos shown in a much smaller box. This check flags your homepage when 20% or more of its images are over 300 KB. By the end, you will have resized, compressed and converted those files, added responsive srcset markup, and confirmed that every homepage image is under 300 KB.

By Updated ⏱ 30–60 minutes🎯 Beginner● Medium impactTechnical
Illustration: Oversized images fix guide
TECHNICAL · FIX GUIDE Oversized images IMPACTEFFORT TIME30–60 minutes LEVELBeginner

Why it matters

Images are usually the heaviest part of a homepage, and the hero image is often the Largest Contentful Paint element. 5-second 'good' threshold in Core Web Vitals, which affects page experience signals and conversion. Heavy pages also use more of visitors' mobile data and slow crawl rendering.

Trimming a 2 MB JPEG to a 180 KB WebP usually causes no visible quality loss.

✕Beforehero-team.jpg: 5472×3648 px, 3.4 MBJPEG, shown in a 1200×600 px banner✓Afterhero-team.webp: 1600×800 px, 168 KB,served through srcset with800w/1200w/1600w versions

What you need

Chrome or Edge DevTools (or Firefox Network panel)
Access to your CMS media library or the site's image files
An image tool: Squoosh.app (browser), ImageMagick, or cwebp/avifenc on the command line
Permission to edit theme templates or page HTML for srcset

Step-by-step fix

1

List every homepage image over 300 KB

Open your homepage in Chrome, press F12, go to the Network tab, click the Img filter and reload with Disable cache ticked. Click the Size column to sort largest first and write down every file above 300 KB. Include CSS background images and slider images, because these count too.

If 20% or more of your images are over the limit, the check fails, but you should aim for zero.

Pro tip: Right-click any column header and enable **Content-Type** to see at a glance which images are still JPEG or PNG.
2

Measure the size each image is displayed at

In DevTools, open the Elements panel and hover over each flagged <img>. The tooltip shows the rendered size, such as 1200 × 600, and the intrinsic size, such as 5472 × 3648. Your target width is the largest rendered width multiplied by 2 for high-density screens.

Cap that width at about 2000 px for full-width heroes and 800–1000 px for cards and thumbnails.

Pro tip: Check at a 1440 px desktop width and at a 390 px mobile width. The largest rendered width sets the biggest file you need.
3

Resize and compress each file

Resize each image to its target width and re-encode it at a sensible quality setting. For photos, JPEG quality 75–82 is usually visually lossless. Use PNG only for graphics that need sharp edges or transparency, and use SVG for logos and icons.

app works for one-off files, and the ImageMagick commands below handle batches.

text
# Single file: resize to 1600px wide, strip metadata, quality 80
magick hero-team.jpg -resize 1600x -strip -quality 80 hero-team-1600.jpg

# Batch: every JPEG in the folder, only shrink images wider than 1600px
magick mogrify -path optimized -resize '1600x>' -strip -quality 80 *.jpg
Pro tip: The `>` flag only shrinks images. It never enlarges a small image and adds bytes.
4

Convert photos to WebP or AVIF

WebP is typically 25–35% smaller than an equivalent JPEG. AVIF is often smaller still. All current browsers support both formats.

Generate a WebP version, and optionally an AVIF version, at each width you need. If you still want a JPEG fallback for very old clients, wrap the image in a <picture> element.

text
cwebp -q 78 -resize 1600 0 hero-team.jpg -o hero-team-1600.webp
cwebp -q 78 -resize 800 0 hero-team.jpg -o hero-team-800.webp
avifenc --min 25 --max 35 hero-team-1600.jpg hero-team-1600.avif
Pro tip: Above roughly quality 85, WebP files grow quickly with no visible gain. Start at 75–80 and only raise it if you see banding.
5

Add srcset and sizes to the image markup

Generate 3–4 widths of each large image and list them in srcset so phones download the small file and desktops get the large one. The sizes attribute tells the browser how wide the image will be rendered. Always set width and height to prevent layout shift.

Use loading="lazy" on below-the-fold images, and fetchpriority="high" (never lazy) on the hero.

html
<picture>
  <source type="image/avif" srcset="/img/hero-team-800.avif 800w, /img/hero-team-1200.avif 1200w, /img/hero-team-1600.avif 1600w" sizes="100vw">
  <img src="/img/hero-team-1200.webp"
       srcset="/img/hero-team-800.webp 800w, /img/hero-team-1200.webp 1200w, /img/hero-team-1600.webp 1600w"
       sizes="100vw"
       width="1600" height="800"
       alt="The Example Co support team in the Leeds office"
       fetchpriority="high">
</picture>
Pro tip: For an image that fills half the screen on desktop and the full width on mobile, use `sizes="(min-width: 1024px) 50vw, 100vw"`.
6

Replace the files and purge caches

Upload the optimized files and update the homepage, theme settings or CSS so they point at the new versions. Then delete or stop referencing the originals. Purge your CMS cache, page-cache plugin and CDN cache so visitors and crawlers receive the new files.

For CSS backgrounds, use image-set() to offer WebP with a fallback.

text
.hero {
  background-image: url('/img/hero-team-1600.jpg');
  background-image: image-set(url('/img/hero-team-1600.avif') type('image/avif'), url('/img/hero-team-1600.webp') type('image/webp'));
}
Pro tip: Sliders and carousels often load every slide on page load. Cut them to one or two slides, or lazy-load the slides after the first.
7

Re-test the homepage

Reload the homepage with DevTools open and Disable cache ticked, then sort the Img filter by Size again. Every image should now be under 300 KB, and most photos should be under 200 KB. com/ and check the Improve image delivery insight.

Finally, re-run the audit to confirm the check passes.

Pro tip: Test the mobile view in DevTools device mode too, to confirm srcset serves the smaller file. In the Network panel, look for the 800w file name.

Platform-specific notes

WordPress

WordPress automatically creates resized copies and adds srcset to images inserted through the block editor. Images over 2560 px are scaled down on upload unless a theme or plugin disables the big_image_size_threshold. Problems usually come from page builders or theme options using the 'Full' size. In the block's settings sidebar, set **Resolution** to Large or Medium. For compression and WebP/AVIF conversion, install a plugin such as ShortPixel, Imagify or EWWW Image Optimizer, then run its bulk optimizer under **Media**.

Shopify

Shopify's CDN serves WebP or AVIF automatically, but it sends whatever width your theme requests. In custom sections, use `{{ section.settings.image | image_url: width: 1600 | image_tag: widths: '400, 800, 1200, 1600', sizes: '(min-width: 990px) 50vw, 100vw' }}` rather than requesting `width: master` or a very large width. Edit sections in **Online Store > Themes > Edit code**.

Wix

Wix resizes images and serves WebP automatically through its media server. Oversized files usually come from GIFs, very large PNGs with transparency, or background videos used as images. Replace large PNG photos with JPEG uploads, and avoid stretching small 'Original size' images in strips.

Webflow

Webflow generates responsive variants and srcset for images placed with the Image element. In the **Assets** panel, select images and use **Convert to WebP or AVIF**. Images set as CSS backgrounds in the Style panel get no responsive versions, so resize those before upload. You can also switch them to an Image element with object-fit: cover.

Next.js / Cloudflare

In Next.js, use `next/image` with an accurate `sizes` prop. Without it, the browser can download the largest generated width. Add `priority` to the hero image. On Cloudflare, Polish (Pro plan and above) recompresses images and can serve WebP. Image Transformations can resize images on the fly with URLs like `/cdn-cgi/image/width=800,format=auto/img/hero.jpg`.

Check that it worked

✅ How to verify

  • Chrome DevTools > Network > Img filter, sorted by Size with cache disabled: no homepage image is above 300 KB.
  • PageSpeed Insights for https://example.com/ no longer lists large savings under the 'Improve image delivery' insight, and LCP has improved.
  • In DevTools mobile emulation, the Network panel shows the smaller srcset file (for example hero-team-800.webp) being downloaded.
  • Re-running the audit shows the Oversized images check passing.

⚠️ Common mistakes

  • Compressing the file but leaving it at 5000+ px wide. Resizing to the display width saves far more bytes than quality tweaks.
  • Adding srcset without a sizes attribute, so the browser assumes 100vw and still downloads the largest version.
  • Lazy-loading the hero image, which delays LCP even when the file is small.
  • Forgetting the CDN or page cache, so the audit and visitors keep receiving the old multi-megabyte files.

Is this still an issue on your site? Run a free audit — ZORO checks this and 294 other SEO, AI-visibility, accessibility and security signals, with fixes for your platform.

Check my site free

FAQ

What is a good file size for website images?

Aim for under 200 KB for full-width hero photos and under 100 KB for cards and thumbnails. This audit flags any homepage image over 300 KB.

Should I use WebP or AVIF in 2026?

Both are supported in all current browsers. AVIF usually produces smaller files for photos but encodes more slowly. WebP is a safe default, and offering AVIF first in a <picture> element gets you the extra savings.

What resolution should images be for retina screens?

About twice the CSS display width, for example 1600 px for an 800 px-wide slot. Going beyond 2× adds bytes with no visible benefit on most devices.

Does image size affect SEO rankings?

Not directly. Image weight affects Largest Contentful Paint, which is part of Core Web Vitals and Google's page experience signals. Fast-loading images also help Google Images indexing and keep mobile visitors from bouncing.