Best Quality Metric for Automated AVIF Tuning

Automating AVIF compression requires an objective metric that accurately reflects human visual perception rather than raw mathematical differences. While traditional metrics like PSNR and SSIM struggle to evaluate AVIF's distinct smoothing and texture-retention characteristics, modern perceptual metrics provide significantly better results. This article explores why SSIMULACRA 2 is currently the optimum visual quality target metric for automated AVIF optimization pipelines, how it compares to alternatives like Butteraugli and VMAF, and how to apply it effectively.

Why Legacy Metrics Fail with AVIF

AVIF relies on the AV1 video codec architecture, utilizing advanced directional transforms, intra-prediction modes, and strong in-loop filtering (such as deblocking and Constrained Directional Enhancement Filters). These features make AVIF highly efficient, but they introduce unique compression artifacts:

Legacy metrics like Peak Signal-to-Noise Ratio (PSNR) and standard Structural Similarity (SSIM) treat all pixel-level discrepancies uniformly. They often reward AVIF's smooth, artifact-free surfaces with artificially high scores, failing to register the severe loss of high-frequency detail and skin textures that a human viewer immediately notices.

The Optimum Choice: SSIMULACRA 2

For automated still-image tuning, SSIMULACRA 2 is currently the industry's premier visual quality metric. Developed specifically to evaluate modern image codecs like AVIF and JPEG XL, it correlates far higher with human Mean Opinion Scores (MOS) than legacy alternatives.

Key Advantages of SSIMULACRA 2 for AVIF:

SSIMULACRA 2 scores typically range from 0 to 100:

Viable Alternatives

While SSIMULACRA 2 provides the highest visual correlation, two alternative metrics are frequently used depending on specific infrastructure constraints:

1. Butteraugli

Developed by Google, Butteraugli models the psychophysics of the human eye, calculating differences in units where a score of 1.0 represents the threshold of just-noticeable difference (JND). It is exceptionally reliable for targeting high-fidelity, visually lossless outputs (typically targeting scores between 1.0 and 1.5). However, it is computationally intensive and less reliable than SSIMULACRA 2 at aggressive, lower-bitrate compression levels.

2. VMAF (Video Multi-Method Assessment Fusion)

Because AVIF originates from the AV1 video standard, systems with existing video-processing infrastructure often rely on Netflix's VMAF. While VMAF performs well on video sequences, standard VMAF models are trained on motion artifacts and temporal pooling. If utilizing VMAF for static AVIF encoding, systems must disable temporal features and run frame-level assessments, aiming for scores between 93 and 96 for high-quality static delivery.

To implement automated AVIF quality tuning:

  1. Set Quality Bounds: Constrain your AV1 encoder (such as libaom-av1 or rav1e) to a constant quality (CRF/CQ) range—typically between CQ 18 and CQ 45—to prevent runaway processing times.
  2. Execute a Bisection Search: Use a binary search algorithm over the encoder's quantization parameters, encoding test frames and evaluating each candidate with SSIMULACRA 2.
  3. Optimize for Target Thresholds: Terminate the search once an image reaches your desired threshold (e.g., an SSIMULACRA 2 score of 75 for standard responsive web assets).
  4. Tune Encoder Pre-filters: If retaining grain is required, pair your metric thresholds with AV1's synthetic film-grain synthesis rather than lowering quantization, which saves bandwidth while keeping SSIMULACRA 2 scores balanced.