AVIF

Formats

AVIF (AV1 Image File Format) is a modern still‑image format that stores an AV1 intra frame in a HEIF container. It delivers high compression efficiency, wide colour and dynamic range support, and features such as alpha transparency and animation. In practical web use, AVIF can substantially reduce image bytes compared with JPEG and WebP at comparable perceptual quality, improving page weight and Core Web Vitals when implemented correctly. Adoption is broad across modern browsers, though encoding is computationally heavier and some edge cases (e.g., sharp graphics) require careful settings or alternate formats.

Compression efficiency

AVIF commonly achieves significant byte savings at equivalent visual quality because it inherits AV1’s advanced intra-frame coding. Independent tests often report reductions of about 30–50% versus JPEG and around 20–40% versus WebP for photographic content at similar perceptual scores. Results depend on encoder, speed preset, chroma subsampling, bit depth, and the chosen quality metric (e.g., SSIMULACRA2, VMAF, MS-SSIM). On image-heavy pages, these per‑asset savings compound into materially lower transfer sizes and faster render paths, especially on constrained networks.

The format is particularly effective at low to medium bitrates, where legacy codecs tend to exhibit blocking, colour bleeding, or banding. AVIF’s in‑loop filtering and flexible transforms suppress common artefacts while maintaining fine detail. For graphics with hard edges or small text, AVIF can be tuned (e.g., 4:4:4 chroma, higher quality, or lossless) but may not always outperform specialised alternatives such as PNG or SVG; file size and sharpness should be verified per use case.

Basis of compression

AVIF stores a single AV1 intra frame inside the HEIF container and leverages AV1’s image-coding tools for efficiency. Key contributors include flexible block partitioning down to 4×4, numerous directional intra predictors, multiple transform types and sizes up to 64×64, and context‑adaptive entropy coding. In‑loop filters such as CDEF and loop restoration help reduce ringing and blocking at low bitrates without excessively blurring detail. Together, these tools enable strong rate–distortion performance across a wide range of content types and target file sizes.

Beyond compression structure, AVIF supports 8‑, 10‑, and 12‑bit depth and multiple chroma formats (4:2:0, 4:2:2, and 4:4:4). Higher bit depths reduce visible banding in gradients and preserve subtle tonal transitions, while 4:4:4 chroma better maintains colour edges in graphics and UI. The HEIF container also enables features like alpha channels, colour management (ICC profiles or nclx), and HDR signalling (e.g., PQ/HLG). These capabilities make AVIF suitable for both standard dynamic range photography and advanced imaging pipelines that require wider gamuts and higher dynamic range.

Browsers (desktop and mobile)

AVIF is supported across modern versions of major browsers on desktop and mobile, including Chromium-based browsers, Firefox, and Safari. Support generally covers still images, alpha transparency, and colour management. Animation support is less consistent and may differ by engine and version, so sites relying on animated AVIF should test target platforms or provide alternate formats. Some older devices and browsers without AVIF decoding will ignore AVIF sources, which is expected behaviour when using the picture element with fallbacks.

Delivery should use the image/avif MIME type, and servers or CDNs often vary responses by the Accept header for content negotiation. Because some caching layers coalesce variants, configure Vary: Accept (and, where applicable, Client Hints such as Width or DPR) to avoid cache poisoning between AVIF and fallback formats. When browser support is uncertain, a picture element ordered as AVIFWebPJPEG/PNG remains a robust approach. As with any modern format, test representative devices and connection profiles to ensure decode performance and visual fidelity meet expectations.

Use cases and limitations

AVIF excels for photographic and mixed‑content imagery: hero banners, product shots, editorial photography, and background images. Features like 10‑bit depth, HDR signalling, and alpha transparency allow it to replace a combination of legacy formats in many pipelines, reducing asset duplication. For UI icons, line art, and logos with flat colours or fine text, AVIF can be effective when encoded as 4:4:4 at higher quality or in lossless mode, but PNG or SVG may produce sharper results at smaller sizes. Animated sequences benefit from AVIF’s efficiency, though cross‑browser animation support and playback performance should be confirmed.

Key trade‑offs include heavier encode times and potentially increased decode cost relative to JPEG and sometimes WebP. Practical mitigations include offline or build‑time encoding, caching at the CDN edge, and choosing suitable speed/quality presets. For colour‑critical work, verify profiles and rendering intent, and prefer higher bit depth to avoid banding. Chroma subsampling at 4:2:0 can soften coloured edges; for UI and text, 4:4:4 is safer. As always, judge outcomes with perceptual metrics and visual review rather than bitrate alone.

Compression efficiency and page weight

On image‑heavy pages, replacing JPEG with AVIF at comparable quality can reduce total image transfer by tens to hundreds of kilobytes per image, which scales to megabytes across galleries or product grids. This directly benefits Largest Contentful Paint (LCP) by shortening the time to download hero images, and can improve First Input Delay/Interaction to Next Paint indirectly by lowering main‑thread contention from decoding and layout work. For sites charged per GB of egress, bandwidth costs usually decline alongside performance gains, particularly for mobile users on constrained networks.

Quantitatively, many teams observe 20–40% savings versus well‑tuned WebP and 30–50% versus optimised JPEG at similar perceptual targets. The realised impact depends on responsive delivery (sizes/srcset), caching behaviour, and whether you retain multiple format variants. To maximise gains, ensure the AVIF source selected by the browser is the smallest that meets the displayed resolution, set long‑lived cache headers, and avoid redundant fallbacks being downloaded. Monitoring with RUM and synthetic tests can validate improvements to LCP and total page weight across device classes.

Implementation notes

Encoding: Popular stacks include libavif with the libaom or dav1d toolchain, image processing libraries (sharp, ImageMagick via libheif), and CLI tools such as cavif or avifenc. Start with 10‑bit depth for photos to reduce banding; use 4:2:0 for photography and 4:4:4 for graphics/text. Tune a constant‑quality target (e.g., a mid‑range CQ) and adjust speed presets to balance encode time and quality. For assets showing colour fringing, increase quality, switch to 4:4:4, or consider lossless for small UI elements. Always embed colour profiles or nclx metadata for consistent rendering.

Delivery: Serve with Content‑Type: image/avif and configure Vary: Accept when negotiating formats. Use the picture element with type hints and provide WebP and JPEG/PNG fallbacks: place AVIF first to allow capable browsers to select it. Pair width/height attributes with responsive srcset and sizes to prevent layout shift and over‑fetching. Consider decoding=async and fetchpriority for LCP images to balance scheduling. Cache AVIF aggressively at the CDN edge, and, where supported, use Client Hints (Width, DPR) or an image CDN to tailor variants without bloating origin storage.

Comparisons

  • AVIF vs WebP: AVIF typically compresses 20–40% smaller at similar quality, especially at lower bitrates; WebP encodes faster and has mature animation support. Use AVIF for primary delivery when size matters, with WebP as a broad fallback.
  • AVIF vs JPEG: AVIF outperforms JPEG in detail retention and artefact suppression at nearly all bitrates, plus supports alpha, HDR, and higher bit depths. JPEG remains ubiquitous and decodes extremely fast but lacks modern features.
  • AVIF vs PNG: For photos, AVIF is dramatically smaller; for flat graphics or pixel‑perfect UI, PNG (lossless) or SVG may yield sharper edges at minimal sizes. AVIF lossless exists but may not beat PNG on line art.
  • AVIF vs JPEG XL: JPEG XL offers strong compression and features, but browser support is limited. AVIF currently has wider practical support for the web, making it the safer production choice.

FAQs

Does AVIF support transparency and animation?

Yes. AVIF supports alpha channels for transparent images and can store animated sequences. Transparency is widely supported across modern browsers. Animation support varies by engine and version, so confirm behaviour in your target browsers and consider alternate formats (e.g., WebP or video) for critical animated assets.

What quality settings work well for web photos?

There is no universal number because encoders expose different quality scales. A common approach is constant‑quality encoding at moderate levels with a 10‑bit, 4:2:0 profile for photography. Validate using perceptual metrics and visual review on representative devices. Increase quality or switch to 4:4:4 for assets that show coloured edge softening, and use lossless sparingly for small UI elements that must remain pixel‑exact.

Is AVIF good for logos and text overlays?

It can be, with the right settings, but outcomes vary. For crisp logos and small text, prefer 4:4:4 chroma and higher quality, or use lossless. PNG and SVG often remain best‑in‑class for simple flat graphics due to perfect edge preservation and deterministic rendering. Evaluate output size and sharpness before standardising on a format for brand assets.

How does AVIF affect SEO or Core Web Vitals?

Search engines do not rank pages differently based on image format, but AVIF can reduce bytes and speed up rendering, which can improve Web Vitals such as LCP and CLS indirectly through responsive sizing and reduced layout shifts. Use picture with accurate sizes/srcset and set explicit dimensions. Monitor results with field data to confirm improvements across real devices and networks.

Do I still need WebP or JPEG fallbacks?

In most production contexts, yes. Although AVIF support is broad, some legacy or embedded browsers lack decoders, and animation support is inconsistent. A layered picture elementAVIF first, then WebP, then JPEG/PNG—ensures reliable delivery. Maintain caching and negotiation so only one variant is downloaded per image.

Synonyms

AV1 Image File FormatAVIF imageAVIF formatAV1 still imageHEIF-AV1