AVIF Local Support

A WordPress Plugin for AVIF Image Conversion

WordPress Plugin Directory / GitHub Repository

I built this plugin because my photography portfolio site needed high-quality images that also loaded quickly. AVIF offers better compression than JPEG with comparable (or better) quality, and better color handling than WebP. The trade-off is that older browsers don’t support it—but for a portfolio aimed at photo editors and art buyers, that’s usually fine.

Why I Made This

Most AVIF solutions I found had one of two problems: they required a subscription, or they didn’t give me control over compression settings. As a photographer, I care about how my images look. I wanted to fine-tune quality settings, preserve color profiles, and handle thumbnails properly.

So I built AVIF Local Support. It runs entirely on your server—no external services, no cloud accounts, no subscriptions.

How It Works

On the front end: The plugin rewrites your <img> tags into <picture> elements that include both AVIF and JPEG sources. Browsers that support AVIF get the smaller file; everyone else gets the original JPEG.

Behind the scenes: When you upload a JPEG (or run a background scan), the plugin converts it to AVIF using whatever image library your server has available:

  1. ImageMagick CLI — The fastest option, with the best quality and full metadata preservation
  2. Imagick PHP extension — Slightly slower but still good
  3. GD Library — A fallback for servers without ImageMagick

The conversion preserves your originals. AVIF files are created alongside your existing images, not in place of them.

Features

  • Local processing — Everything happens on your server. Works on shared hosting with modest resources
  • Quality controls — Set quality (0-100), speed (0-10), chroma subsampling, and bit depth
  • Metadata preservation — Keeps EXIF, XMP, IPTC, and ICC color profiles intact (when using ImageMagick)
  • Automatic fallback — Serves JPEG to browsers that don’t support AVIF
  • Background conversion — Can run scheduled jobs to convert existing images gradually
  • WP-CLI commands — Convert, check status, view stats, and manage logs from the command line
  • Detailed diagnostics — The admin panel shows exactly what your server supports and what’s happening

What to Expect

AVIF files are typically 50-80% smaller than equivalent JPEGs. This can improve page load times and Core Web Vitals scores. Whether that matters for your site depends on your audience and how image-heavy your pages are.

Requirements

  • WordPress 6.8+
  • PHP 8.3+
  • ImageMagick with AVIF support (recommended) or GD with libavif

The plugin includes diagnostics to help you figure out what your server supports and what you might need to upgrade.

Links