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:
- Over-smoothing and texture loss: Rather than exhibiting the distinct high-frequency blockiness common to legacy JPEG, low-to-medium bitrate AVIF images tend to blur micro-textures and fine details.
- Chroma shifts and ringing: Aggressive subsampling and quantization can cause color bleed or subtle halos around sharp contrasts.
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:
- Perceptual Color Space Handling: SSIMULACRA 2 operates in the JzAzBz color space, which closely mirrors human perception of luminance and chrominance across standard and High Dynamic Range (HDR) content.
- Sensitivity to Blurring and Texture Smearing: Unlike SSIM, it penalizes the specific edge-blurring and texture erasure characteristic of AV1 intra-frame coding.
- Multi-Scale Feature Analysis: It evaluates structural deviations, contrast changes, and artifact visibility across multiple scales, mimicking human fixation patterns.
Recommended Target Scores
SSIMULACRA 2 scores typically range from 0 to 100:
- 85–90+: Visually lossless under close inspection. Ideal for hero images, photography portfolios, and archival delivery.
- 70–80: High-efficiency web delivery. Perceptually clean under typical viewing conditions with minimal noticeable degradation.
- Below 65: Visible blur and structural degradation become noticeable to casual viewers.
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.
Recommended Implementation Strategy
To implement automated AVIF quality tuning:
- Set Quality Bounds: Constrain your AV1 encoder
(such as
libaom-av1orrav1e) to a constant quality (CRF/CQ) range—typically between CQ 18 and CQ 45—to prevent runaway processing times. - 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.
- 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).
- 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.