How to compress WebP and AVIF images

When compressing WebP and AVIF again pays off, what we measured, the settings to use, and how to keep the format, transparency and HDR.

· 5 min read

WebP and AVIF are already efficient formats, so it’s fair to ask whether compressing them again does anything. It often does: how much depends on how the file was saved. A WebP or AVIF exported at a high quality setting can lose about half its size, while one a website already squeezed shrinks much less. Here is how to tell which you have, the settings to use, and what stays the same.

When compressing again pays off

Editors, cameras and export tools often save at a high quality setting to play it safe. Websites and image CDNs usually save at a lower one, because page speed matters more to them. We compressed photos of 1800 to 4000 pixels wide, saved both ways, with Graviton’s default settings:

The file you start withSaved at quality 75
WebP exported at quality 9247–57%
WebP saved at quality 80, typical of websites17–19%
AVIF saved by libavif at quality 60–8048–61%

Your own images will differ, since detailed and noisy photos compress less than smooth ones. If no setting can make a file smaller, Graviton hands back your original, pixel for pixel, rather than a bigger file.

Every lossy save costs a little

Lossy formats throw detail away each time they are saved, and saving an already compressed image again adds new losses on top of the old ones. One extra save at a sensible quality is rarely visible. Compressing the same file over and over, or at a very low quality, is. Two habits avoid it:

  • Start from the original when you have it. If the WebP was made from a JPG or PNG, convert that original instead, with JPG to WebP or JPG to AVIF.
  • Compare before you download. Drag the before-and-after slider over faces, hair, text and skies, where losses show first.

Settings for WebP

  • Quality 75 suits most website images, and it’s where the slider starts.
  • Quality 85–90 for product photos and artwork that must look their best.
  • Lossless, under More options, for logos, screenshots and graphics that must stay pixel-perfect. It keeps every pixel, so it saves less.
  • Exact file size when an upload form sets a limit: type it, and Graviton finds the highest quality that fits.

Graviton encodes WebP with libwebp, Google’s reference encoder, using sharp color conversion, which keeps thin colored edges clean. Transparent areas keep their full quality.

Compress WebP imagesMake WebP images smaller. They stay WebP and keep their transparency.

Settings for AVIF

  • Quality 75 is a good start for photos. Lower it only after checking skin, hair and foliage, where AVIF tends to smooth fine texture.
  • Give large photos a moment. AVIF takes longer to encode than JPG or WebP. Graviton uses a faster encoder setting for large photos, so they stay quick to compress on phones too.
  • Keep HDR stays on for HDR photos. An AVIF with an HDR gain map keeps it, so it still glows on HDR screens. Turn it off under More options for a smaller, standard photo.
  • Lossless works for AVIF too, for graphics that must not change.
Compress AVIF imagesMake AVIF images even smaller, keeping transparency and HDR.

What stays the same, and what doesn’t

  • Format and file name. A WebP comes back as a WebP and an AVIF as an AVIF, with the same name, so you can swap them into a website without renaming anything.
  • Width, height and transparency stay as they are, unless you turn on Crop or Resize.
  • Metadata is removed by default, including the location. A WebP can keep the date taken, copyright, camera or location if you pick them under Keep metadata. AVIF files can’t carry them yet.
  • Animation isn’t kept yet. An animated WebP or AVIF comes out as a still image of its first frame, and Graviton says so when you add one. Keep animated files as they are for now. Animated GIFs keep every frame in the GIF compressor.

Or change the format

Sometimes the better move is a different format. For your own website, AVIF is often 20–30% smaller than WebP again, so a WebP that is still too heavy can go to AVIF by picking AVIF under Format. For sharing, email and upload forms that reject modern formats, WebP to JPG and AVIF to JPG give you a file that opens everywhere.

How to compress WebP and AVIF in Graviton

  1. Open Compress WebP or Compress AVIF, and drop your images in. A whole folder works too.
  2. Press Compress. The quality starts at 75; change it, or switch to Exact file size.
  3. Compare before and after, then download each image, or all of them as a ZIP that keeps their names.

Everything runs in your browser, so your images are never uploaded. Compressing is free and unlimited; downloading takes a free account.