Performance

Image optimisation in practice: we tested PNG, JPEG, WebP and AVIF

We encoded the same photo four ways and measured the results. AVIF came out 54% smaller than JPEG, and sizing it for its slot cut it by more than half again.

Raihan
· Updated 5 November 2026 · 3 min read
On this page 5 sections
  1. 01The test
  2. 02Size matters more than format
  3. 03Browser support
  4. 04Doing it in WordPress
  5. 05The checklist

Key takeaways

  • In our test, the same 1440 × 900 photo was 1,641 KB as PNG, 264 KB as JPEG, 170 KB as WebP and 122 KB as AVIF.
  • Serving it at the 800 px it is actually displayed at brought the AVIF down to 49 KB.
  • Images are still the biggest part of a typical page: 900 KB of a 2.3 MB median mobile home page in 2024.
  • AVIF works in all current major browsers, and WordPress has supported AVIF uploads since version 6.5.
  • Always set width and height, and never lazy-load the main hero image.

Images are usually the heaviest thing on a page. In HTTP Archive’s 2024 data, the median mobile home page weighed 2,311 KB, and 900 KB of that was images. So we ran a simple test to see how much the format and size really matter.

The test#

We took one photographic screenshot, the Ocean Point Estates home page at 1440 × 900 pixels, and encoded it with PHP’s GD library, the same library many WordPress hosts use. Quality settings were chosen to look the same to the eye: JPEG at 82, WebP at 80 and AVIF at 55.

One photo, four formatsThe same 1440 × 900 photo. Lower is better.
1,640.7 KBPNG
263.9 KBJPEG
170.3 KBWebP
121.8 KBAVIF
Show the data
FormatFile size
PNG1,640.7 KB
JPEG263.9 KB
WebP170.3 KB
AVIF121.8 KB

Source: Zenotia test, October 2026 (PHP GD: JPEG q82, WebP q80, AVIF q55)

AVIF came out 54% smaller than JPEG and 28% smaller than WebP. PNG, which is lossless, was more than six times the size of the JPEG. It is the right choice for logos and screenshots of text, and the wrong one for photos.

Size matters more than format#

The photo is displayed at about 800 pixels wide in a card, so sending the full 1440 pixels wastes most of the download. Resizing first made the biggest difference of all.

1,641 KBPNG at full size, as uploaded
122 KBAVIF at full size
49 KBAVIF at the 800 px it is displayed at
Show the data
ItemValue
PNG at full size, as uploaded1,641 KB
AVIF at full size122 KB
AVIF at the 800 px it is displayed at49 KB

Source: Zenotia test, October 2026

Browser support#

FormatChromeFirefoxSafariBest for
JPEGYesYesYesUniversal fallback for photos
WebPYesYesYes (14+)Photos and graphics, wide support
AVIFYes (85+)Yes (93+)Yes (16.4+)Photos, smallest files
SVGYesYesYesLogos, icons, illustrations

Doing it in WordPress#

WordPress already creates several sizes of every upload and adds srcset and sizes so the browser picks the right one. Since version 6.5 it also accepts AVIF uploads, as long as your host’s image library supports it. Tools → Site Health → Info → Media Handling tells you.

To have WordPress convert JPEG uploads to AVIF automatically, a few lines in your theme or a small plugin will do it:

// Save JPEG uploads (and their resized copies) as AVIF.
add_filter( 'image_editor_output_format', function ( $formats ) {
	$formats['image/jpeg'] = 'image/avif';
	return $formats;
} );

If you write the markup yourself, a picture element offers modern formats with a safe fallback:

<picture>
  <source type="image/avif" srcset="/team-800.avif 800w, /team-1600.avif 1600w" sizes="(min-width: 60em) 50vw, 100vw">
  <source type="image/webp" srcset="/team-800.webp 800w, /team-1600.webp 1600w" sizes="(min-width: 60em) 50vw, 100vw">
  <img src="/team-800.jpg" width="800" height="500" alt="The team reviewing a design" loading="lazy">
</picture>

The checklist#

  • Resize before you upload. A 4,000-pixel photo straight from a phone is never needed on a website.
  • Use AVIF or WebP for photos, SVG for logos and icons, PNG only where you need lossless detail.
  • Always set width and height so the layout does not jump while images load.
  • Lazy-load images below the fold, and never the main image at the top of the page.
  • Give the hero image fetchpriority="high".
  • Write alt text that describes the purpose of the image.

If an image on a content page is over 200 KB, something in the pipeline is usually wrong. Check its dimensions first.

Sources and further reading

  1. Web Almanac 2024: Page Weight — HTTP Archive almanac.httparchive.org
  2. WordPress 6.5 adds AVIF support — Make WordPress Core make.wordpress.org
  3. AVIF image format — Can I use caniuse.com
  4. Responsive images — web.dev web.dev

Free website check

How does your site measure up?

Run the free check: security, search, accessibility and speed basics in about 20 seconds. No email needed.

Want a person to look? One-off audits from £400, at a fixed fee.

Keep reading

Ready to start?

Let’s build something great together.

Book a free 15-minute consultation. We will listen, ask the right questions and tell you honestly what we would do first.

Prefer email? sales@zenotia.com