Lean Image
Open menu

The AVIF format

AVIF is a video codec doing still images, and it is very good at it — commonly a third to a half the size of a JPEG that looks the same, with 12-bit colour, wide gamut, HDR and real transparency. Two things temper that. It is the slowest format here to encode, because the compression comes out of a search. And software outside your browser may still have no idea what it is.

AVIF at a glance

Introduced
2019 · Alliance for Open Media
File extensions
.avif
MIME type
image/avif
Compression
Lossy or lossless
Transparency
Yes, with soft edges
Animation
Yes
Colour depth
12 bits per channel
Wide gamut
Yes
High dynamic range
Yes
Maximum dimension
No practical limit
Support
Every current browser; some older software will not

Lean Image reads AVIF and writes it.

Where it came from

AVIF is a consequence of a licensing argument. When HEVC succeeded H.264, its patent pools multiplied rather than consolidated, and the cost and uncertainty of shipping an HEVC decoder in a browser turned out to be unacceptable to the companies that ship browsers. In 2015 those companies — Google, Mozilla, Netflix, Amazon, Microsoft, Cisco, Intel, later Apple — formed the Alliance for Open Media and built their own codec instead. AV1 was finalised in 2018 with an explicitly royalty-free licence.

AVIF, published in 2019, is AV1 keyframes in the same ISO base media container family HEIC uses. The two formats are close cousins: same lineage, same box structure, comparable results. What separates them is the licence on the codec inside, and that single difference decided which of them browsers were willing to support.

What it buys you

Size, first and mostly. At a quality you would accept for a photograph on a web page, AVIF is routinely a third to a half smaller than the equivalent JPEG, and it keeps its advantage at the aggressive end of the scale where JPEG falls apart into blocks.

Beyond that it carries 12 bits per channel rather than 8, so gradients stay smooth instead of banding; wide colour, so saturated reds and greens survive; HDR; a full alpha channel with soft edges; and animation. It is the most capable format this tool can write, by a distance.

What it costs

Time. The encoder is doing a video encoder’s job — evaluating many block partitions and prediction modes and keeping the cheapest — over one frame. A large photograph is not instant, and a batch of them is a wait. That search is exactly where the small file comes from, so it is a trade rather than an inefficiency.

Texture, at low quality. Push an AVIF hard and it does not break into blocks like a JPEG; it smooths. Fine grain, fabric and foliage go slightly waxy. Whether that is better or worse than blocking is a matter of taste, but it is a different failure and worth knowing before you take the quality down.

Small files. Container overhead means a tiny icon can come out larger than a PNG. AVIF is for photographs and large images.

Where it actually opens

Every current browser: Chrome from 2020, Firefox from 2021, Safari from 2022. That is genuinely universal on the web, and it is why AVIF is a reasonable default for images you are serving.

Everywhere else is patchy. Windows needs an extension installed before Explorer will make a thumbnail, older editors need a plugin, and plenty of upload forms, email clients and content systems reject the type. If an AVIF has been refused by something, it is not corrupt — it is early.

What to convert it to

JPG if something rejected the file, or if it is going to a person rather than to a browser. Expect it to grow considerably.

PNG if it is going into an editor, or if the transparency has to be preserved exactly.

WebP as the middle ground: still much smaller than JPEG, far faster to encode than AVIF, and supported by more software than AVIF is.

Convert a AVIF into something else

Convert something else into AVIF

Questions about AVIF

Why is AVIF so slow to encode?

Because an AV1 encoder earns its file size by searching: it tries many ways of splitting each region into blocks and many ways of predicting each block, and keeps the cheapest. That search is the compression. Nothing about it is wasted work, but it does take real time on a large photograph.

Is AVIF better than HEIC?

They land in much the same place on size, being the same generation of technology. The difference is legal, and it decides everything else: AV1 is royalty-free, so browsers shipped AVIF, while HEVC is patent-licensed, so they did not ship HEIC. AVIF opens on the web; HEIC opens on Apple devices.

Why can my photo editor not open an AVIF?

Browsers adopted it quickly and desktop software did not. Windows wants the AV1 Video Extension from the Store, older versions of Photoshop need a plugin, and a good number of upload forms and content systems still reject the file type outright. Convert to JPG or PNG when you hit one.

Is a small icon smaller as an AVIF?

Often not. The container carries a few hundred bytes of structure before any image data, which is irrelevant on a photograph and significant on a 2 kB icon. For small flat graphics, PNG or WebP usually wins. AVIF pays off on photographs and large images.

Does choosing AVIF here download anything?

Yes — a WebAssembly build of the libavif encoder, fetched the first time you choose AVIF and never otherwise, so a JPEG-to-WebP session downloads none of it. It runs in your browser like everything else here; the image itself is never uploaded anywhere.

Work with a AVIF file

Drop one in and see what comes out, without uploading anything.