Prompt

How do I switch my site images to AVIF?

Technology / CDN & Edge Infrastructure1 observationLast seen Nov 3, 2026

Latest observation

Nov 3, 2026OpenAI APIWeb search: off

Switching site images to AVIF usually means changing your image pipeline so browsers get AVIF where supported, with a fallback to WebP/JPEG/PNG for older browsers.

Best approach

1) Keep your original images

Don’t replace your source files with AVIF only. Keep originals like:

  • .psd, .ai, .png, .jpg, .webp
  • generate AVIF derivatives at build time or upload time

2) Generate AVIF versions

Use an image tool or build step.

Examples:

Using sharp in Node.js

import sharp from "sharp";

await sharp("input.jpg")
  .avif({ quality: 50 })
  .toFile("output.avif");

Using ImageMagick

magick input.jpg -quality 50 output.avif

Using cwebp/avifenc or build tools

If you already use a bundler, plugins often handle this automatically.


3) Serve AVIF with fallback

Use <picture> so browsers can choose the best format:

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

If AVIF is supported, the browser uses it; otherwise it falls back to WebP or JPEG.


4) For CSS background images

Use image-set():

.hero {
  background-image: image-set(
    url("hero.avif") type("image/avif"),
    url("hero.webp") type("image/webp"),
    url("hero.jpg") type("image/jpeg")
  );
}

You may still need a fallback rule for browsers that don’t support image-set() well.


5) Use responsive sizes

AVIF helps most when paired with responsive images:

<picture>
  <source
    type="image/avif"
    srcset="img-480.avif 480w, img-960.avif 960w, img-1440.avif 1440w"
    sizes="(max-width: 768px) 100vw, 50vw">
  <img
    src="img-960.jpg"
    srcset="img-480.jpg 480w, img-960.jpg 960w, img-1440.jpg 1440w"
    sizes="(max-width: 768px) 100vw, 50vw"
    alt="Description">
</picture>

Important considerations

Browser support

AVIF is supported in modern browsers, but not all older ones. That’s why fallbacks matter.

Quality setting

AVIF is usually smaller than JPEG/WebP at similar visual quality, but encoding can be slower. A common starting point is:

  • photos: quality around 45–60
  • graphics/screenshots: test carefully, sometimes higher quality is needed

Transparency

AVIF supports transparency, so it can replace PNG in many cases.

Animation

AVIF can support animation, but support/performance can vary. Test before using it for animated assets.


If you use a CMS or framework

Many platforms can auto-generate AVIF:

  • Next.js: use next/image with an image loader or built-in optimization depending on setup
  • Astro / Vite / Nuxt / Gatsby: often via plugins
  • WordPress: plugins or server-side image optimization services
  • Cloudinary / Imgix / ImageKit: can serve AVIF automatically based on browser support

Simple migration plan

  1. Inventory your image types: hero images, thumbnails, icons, backgrounds.
  2. Generate AVIF for photo-like images first.
  3. Add <picture> or equivalent fallback handling.
  4. Test across Chrome, Safari, Firefox, Edge.
  5. Measure page weight and visual quality.
  6. Gradually expand to the rest of the site.

If you tell me what your site uses—plain HTML, WordPress, Next.js, Shopify, etc.—I can give you the exact steps and code for that stack.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.