Rasp

File format

AVIF

The most aggressive compression in common use — a still image built on a video codec, and slow to encode for exactly that reason.

What is an AVIF file?

AVIF is a still image stored using the AV1 video codec, published in 2019 by the Alliance for Open Media. It compresses considerably harder than JPG or WebP, supports transparency and HDR, and is displayed by every current browser. Encoding it is slow, and support outside browsers remains thin.

The facts

Full nameAV1 Image File Format
File extensions.avif
MIME typeimage/avif
Introduced2019
Created byAlliance for Open Media
CompressionLossy and lossless
TransparencySupported
SpecificationAV1 Image File Format (AVIF)

What AVIF actually is

A single frame of AV1 video, wrapped in an image container.

That is not a simplification. The Alliance for Open Media — Google, Netflix, Amazon, Mozilla, Microsoft, Apple and others — built AV1 to cut streaming bandwidth. AVIF applies that codec to still pictures, which means still images inherit a decade of compression research funded by the economics of video.

The result is the most aggressive compression in common use.

The measured saving

On the fixed test image used across this site, from the same source:

Format Size
PNG (lossless) 3.97 MB
JPG 375 KB
WebP 247 KB
AVIF 109 KB

Against JPG that is a 73% reduction. Against WebP, 56%.

These are figures produced by this site’s own converters, on a corpus you can regenerate — not vendor claims.

Why it is royalty-free, and why that matters

AVIF and HEIC are technical siblings. Both are still images built on a video codec, in the same container family. HEIC uses HEVC; AVIF uses AV1.

The difference is legal, and it decided which one the web adopted. HEVC is covered by a contested patent pool, so shipping an encoder is a licensing negotiation. AV1 was designed from the outset to be royalty-free, precisely so that browsers could ship it without one.

That is why every current browser can write AVIF and none can write HEIC — including this site, which encodes AVIF locally but can only ever decode HEIC.

The cost is encoding time

AVIF encoding is slow. On this site it is by a clear margin the slowest operation, and a large image takes seconds where JPG takes milliseconds.

The slowness is the mechanism working. AV1 spends that time searching a much larger space of possible encodings, and the small file is what it finds.

The trade is excellent for web images, which are encoded once and served many times. It is a poor trade for a one-off conversion you need immediately.

Note that decoding is fast — your visitors pay nothing for your encoding time.

Serve it with a fallback

The strongest way to use AVIF is not to choose:

<picture>
  <source srcset="photo.avif" type="image/avif" />
  <source srcset="photo.webp" type="image/webp" />
  <img src="photo.jpg" alt="…" />
</picture>

Current browsers take the smallest file, older ones fall back, nothing breaks.

Converting

Into AVIF from JPG, PNG or WebP. Out of it to JPG for compatibility, PNG for editing, or WebP for a middle ground.

Convert from your best available source rather than from an existing lossy file — WebP vs AVIF explains why the difference is worth the trouble.

Convert AVIF files

From AVIF

To AVIF

Questions

How do I open an AVIF file?
Drag it into any current web browser — all of them display AVIF. For editing, most desktop software still refuses it, so converting to JPG or PNG first is usually the practical route.
Is AVIF better than WebP?
On compression, substantially. On our fixed test image the same source came out at 109 KB as AVIF and 247 KB as WebP. On encoding speed, WebP wins by a wide margin, and it is accepted by slightly more non-browser software.
Why is AVIF so slow to encode?
Because AV1 searches far harder for an efficient encoding than older codecs do. That search is precisely where the file size saving comes from — the slowness is the mechanism working, not a defect. Decoding, which is what your visitors do, is fast.
Does AVIF support transparency?
Yes, fully, including partial transparency. It also supports HDR and wide colour gamut, which neither JPG nor WebP handles well.
Which browsers support AVIF?
Chrome, Edge, Firefox, Opera and Safari, plus their mobile versions. Safari added support in 2022, so AVIF is safe for general web use but less forgiving than WebP if your audience runs older devices.
Is AVIF related to HEIC?
Structurally, closely. Both are still images built on a video codec and stored in the same container family — HEIC uses HEVC, AVIF uses AV1. The decisive difference is licensing: AV1 is royalty-free by design, which is why browsers ship AVIF encoders and none ship HEIC encoders.
Should I use AVIF on my website?
Yes, if you serve it alongside a fallback. A picture element offering AVIF first and WebP or JPG second gives current browsers the smallest file and older ones something they can render.
Can I email an AVIF file?
Don't. Support outside browsers is thin enough that the recipient may simply be unable to open it. Convert to JPG for anything you send to a person.

Sources