I compressed the entire FileMint blog image library to AVIF last month and cut bandwidth usage in half. A product screenshot that was 280 KB as a PNG dropped to 48 KB as AVIF at the same visual quality. But AVIF has a real trade-off: encoding is slow. On low-end devices and in certain browsers, WebP is still the pragmatic choice. Here is the actual comparison.
Convert images to AVIF or WebP, locally.
Your images never leave your device. No upload. No server processing. Compressed in milliseconds.
Open Image Compressor โWhat AVIF Actually Is
AVIF stands for AV1 Image File Format. It uses intra-frame compression from theAV1 video codec(developed by the Alliance for Open Media) applied to still images. AV1 was designed from scratch in 2018 to outperform VP9 and H.265, and AVIF inherits those compression algorithms for photos.
WebP was released by Google in 2010. It uses VP8 video compression for lossy encoding and a custom lossless variant. It improved on JPEG and PNG in most benchmarks at the time, but it predates the AV1 codec by eight years.
The Compression Numbers
According toNetflix AVIF researchand independent testing by theCtrl.blog image codec study, AVIF saves approximately 50% versus JPEG and 20% versus WebP at equivalent visual quality (measured by SSIM and DSSIM metrics).
| Format | Median File Size | SSIM Score | Transparency | HDR Support | Animation |
|---|---|---|---|---|---|
| JPEG | 150 KB | 0.92 | No | No | No |
| PNG | 420 KB | 1.00 (lossless) | Yes | No | No |
| WebP | 105 KB | 0.94 | Yes | No | Yes |
| AVIF โ | 75 KB | 0.96 | Yes | Yes | Yes |
The same source image encoded to each format โ lower is better. Figures from the comparison above.
Can I Use AVIF in 2026? Browser Support
Yes โ AVIF now has over 93% global browser support according toCan I Use. The short version: Chrome 85+ (2020), Firefox 93+ (2021), Safari 16+ (September 2022), and Edge 121+ (January 2024) all decode AVIF.
The remaining 7% is primarily old Safari on iOS 15 and below and legacy Edge. A WebP fallback covers all browsers that support WebP but not AVIF. The correct implementation uses the HTML <picture> element:
1<!-- Serve AVIF to supported browsers, WebP as fallback, JPEG as last resort -->2<picture>3 <source srcset="/hero.avif" type="image/avif" />4 <source srcset="/hero.webp" type="image/webp" />5 <img6 src="/hero.jpg"7 alt="Hero image showing FileMint converter interface"8 width="1200"9 height="630"10 loading="lazy"11 />12</picture>Where WebP Still Wins: Encoding Speed
AVIF's compression advantage has a cost: encoder speed. AVIF encoding is significantly slower than WebP at the same quality level.
1# Encoding a 2000x1500px photo at quality 80 on an M2 MacBook Pro2# (using sharp npm package, based on libvips)3ย 4WebP encode time: ~35ms โ output: 110 KB5AVIF encode time: ~450ms โ output: 72 KB6ย 7# AVIF is 12x slower to encode, but 35% smaller output8# For real-time browser-side conversion: WebP is more responsive9# For pre-processed build pipeline: AVIF is worth the waitFor a static site build pipeline (Next.js, Astro, Hugo), AVIF encoding runs once at build time, the 450ms per image is invisible to users. But for real-time browser-side image conversion tools like FileMint's compressor, WebP produces faster results with nearly as good compression.
Implementing AVIF in Next.js
Next.js automatically serves AVIF through itsImage componentwhen you configure the formats in next.config.js:
1// next.config.js2module.exports = {3 images: {4 formats: ['image/avif', 'image/webp'],5 // AVIF is tried first; WebP used if browser doesn't support AVIF6 // Falls back to the src format (JPEG/PNG) if neither is supported7 },8};9ย 10// In your component โ Next.js handles format negotiation automatically11import Image from 'next/image';12ย 13export default function Hero() {14 return (15 <Image16 src="/hero.jpg"17 alt="Chrome DevTools Network tab showing AVIF image payload"18 width={1200}19 height={630}20 priority // LCP image โ load eagerly21 />22 );23}With this configuration, Next.js sends AVIF to Chrome, Safari 16+, and Firefox 93+. It sends WebP to older browsers. Your source image can remain as JPEG or PNG, conversion happens on-demand and is cached automatically.
Edge Cases and Common AVIF Problems
Small Thumbnails: AVIF Can Be Larger Than WebP
AVIF's compression advantage disappears for very small images. At dimensions below ~100ร100 pixels, the AVIF container overhead can make the file larger than an equivalent WebP or even JPEG.
1# 32x32px icon compression test2JPEG: 1.2 KB3WebP: 0.8 KB โ winner for small icons4AVIF: 1.4 KB โ larger than JPEG at this size!5ย 6# Rule of thumb: use WebP (or PNG) for icons and thumbnails below 100pxHigh-Contrast Images and Color Banding
AVIF at low quality settings (below quality 60) can produce visible color banding on gradients and flat-color graphics. WebP handles these cases more gracefully. For UI screenshots, illustrations, and graphics with large flat areas, test AVIF at quality 75+ before committing to it.
Out-of-Memory Errors with Large AVIF Files
The Sharp image processing library (used in Node.js) has a known memory constraint with AVIF encoding of very large images. Encoding a 6000ร4000 AVIF on a server with less than 2GB available memory can cause the process to crash.
1// Handle sharp AVIF memory errors gracefully2import sharp from 'sharp';3ย 4async function convertToAvif(inputPath: string, outputPath: string) {5 try {6 await sharp(inputPath)7 .resize({ width: 2000, withoutEnlargement: true }) // cap max dimension8 .avif({ quality: 75, effort: 4 }) // effort 4 = balanced speed/quality9 .toFile(outputPath);10 } catch (err) {11 // Fall back to WebP if AVIF encoding fails12 console.warn('AVIF encoding failed, falling back to WebP:', err.message);13 await sharp(inputPath)14 .resize({ width: 2000, withoutEnlargement: true })15 .webp({ quality: 80 })16 .toFile(outputPath.replace('.avif', '.webp'));17 }18}iOS 15 AVIF Rendering Bug
Safari on iOS 15 has a known bug where AVIF images with transparency (alpha channel) render with incorrect colors. The fix is to always include a WebP fallback in your<picture> tag, which you should be doing anyway. iOS 16 resolved this.
My Recommendation: AVIF for Production, WebP as Fallback
I encode all new production images as AVIF in the build pipeline. The 50% size reduction over JPEG reduces LCP time directly, which is a Google ranking signal under Core Web Vitals.
Use this decision matrix:
| Scenario | Use | Reason |
|---|---|---|
| Hero images, blog photos, product shots | AVIF + WebP fallback | Maximum compression for large visuals |
| Icons, thumbnails below 100px | WebP or SVG | AVIF overhead exceeds savings at small sizes |
| Screenshots and UI illustrations | AVIF quality 75+ | Test for banding on flat colors |
| Real-time browser-side conversion | WebP | AVIF encoder is 12ร slower in-browser |
| Transparency required (logos, overlays) | AVIF + WebP fallback | Both support alpha; AVIF has iOS 15 bug caveat |
If you are using image optimization as part of a broader site speed effort, read our complete image optimization guide for the full checklist, resizing, lazy loading, and responsive srcset setup. And if you are compressing images locally without uploading them, our web performance case study shows the real PageSpeed score improvements from a production site migration.
Compress to AVIF or WebP: right now.
Our browser-based compressor converts your images locally. No upload. No cloud processing. Drop your file and download compressed AVIF or WebP in seconds.
Open Image Compressor โ