Skip to content
Back to the journal
SEO & performanceFIELD NOTES / 55

AVIF vs WebP: faster images without losing the detail

Compare AVIF, WebP, JPEG, and SVG for website images. Learn responsive sizing, compression tradeoffs, loading priorities, and how to keep mobile pages stable.

A translucent prism splitting a beam into several paths, illustrating image optimization.
A translucent prism splitting a beam into several paths. Original illustration for the RaagNeet Journal.

A large image can make a polished website feel slow on a phone. Modern formats help, but choosing AVIF or WebP is only one part of the work. The biggest gains often come from serving the right dimensions, using an appropriate asset type, and making the important image available at the right point in the loading sequence.

01Choose the right kind of asset

AVIF is based on the AV1 codec and can provide efficient raster compression. WebP is another widely supported format for raster images. Neither should automatically replace an SVG icon or a simple vector illustration that stays crisp and compact in its original form. [1]

For photographs and textured artwork, compare encodings at similar perceived quality. For diagrams with small text, inspect sharpness and colour edges carefully. A smaller file is not an improvement if readers can no longer understand the information it contains.

02Give the browser useful size information

Responsive image markup can offer multiple source widths and describe the expected display size. The browser can then choose an appropriate resource using information about the viewport and device. The picture element can also provide explicit source selection for format support or art direction. [2]

An illustrative article grid may show a cover at roughly one-third of the desktop container and nearly the full mobile width. Sending one oversized original to every card wastes transfer and decoding work. Keep the sizes description aligned with the actual layout breakpoints.

An illustrated decision flow: Choose the asset → Resize for display → Compare quality → Load intentionally.
A practical framework: Choose the asset → Resize for display → Compare quality → Load intentionally. This is an illustrative workflow, not a measured benchmark.

03Compare quality with real content

Use representative images: a photograph, a gradient-heavy illustration, and a diagram with labels. Compare output sizes and inspect them at their intended display scale. Codec quality settings are not directly interchangeable, so the same numeric setting does not create a fair visual comparison across formats.

Include encoding time and cache behaviour in the operational decision. A format that saves a modest amount of transfer may require more processing at generation time. Pre-generating stable article assets can be simpler than repeating expensive transformations on every uncached request.

04Load the important image deliberately

The likely largest visible image should be discoverable early and generally should not be lazy-loaded. Below-the-fold illustrations can wait. Reserve image dimensions or an aspect ratio so the layout remains stable while resources arrive.

Avoid preloading every image in a grid. That creates competition with the actual main content. Inspect the browser's network waterfall to see when the important asset is discovered, requested, and rendered. Format changes will not fix a delay caused mainly by late discovery.

05Keep accessibility and maintenance in the workflow

Write alt text that describes the image's purpose in its context. Use empty alt text for purely decorative assets where appropriate, and include a nearby explanation when a diagram carries important information. Do not stuff keywords into descriptions that a screen-reader user has to listen to.

Keep source assets, generation settings, and stable filenames so images can be regenerated when the design changes. Test narrow screens, high-density displays, slow connections, and zoom. A well-optimised image remains clear, appears at the right time, and supports the article instead of making the reader wait for decoration.

A LITTLE MORE CLARITY

Common questions

Is AVIF always smaller than WebP?

No. Results depend on the image, encoder, quality target, and settings. Compare representative assets at similar perceived quality rather than choosing by format alone.

Should every image be lazy-loaded?

No. Lazy loading the main visible image can delay the page’s important content. Load that image promptly and reserve lazy loading for content further down the page.

FOLLOW THE THREAD

Sources & further reading

Primary documentation and further reading are linked below. Examples and decision frameworks are illustrative; product capabilities can change.

  1. web.dev: AVIF image format
  2. web.dev: Responsive images
  3. MDN: Multimedia image performance

Created with AI assistance for the RaagNeet Journal. This guide does not claim original product testing or benchmark results. Original illustrations by RaagNeet. Send a correction.

image optimizationweb performanceCore Web Vitals