SSIM, PSNR, and VMAF: Evaluating AVIF Compression
Evaluating the visual quality of AVIF (AV1 Image File Format) images requires objective metrics that can accurately predict human perceptual fidelity after lossy compression. This article examines how Peak Signal-to-Noise Ratio (PSNR), Structural Similarity Index Measure (SSIM), and Video Multi-Method Assessment Fusion (VMAF) quantify distortion in compressed AVIF files, detailing their core mechanics, strengths, and limitations when applied to AV1-based still images.
Peak Signal-to-Noise Ratio (PSNR)
PSNR is a traditional mathematical metric that measures the ratio between the maximum possible power of an image and the power of corrupting noise, derived directly from Mean Squared Error (MSE). When evaluating AVIF images, PSNR compares the original, uncompressed source against the compressed output pixel by pixel.
- Mechanics: It computes the logarithmic difference between corresponding pixel values across color channels (typically luminance/Y).
- Application to AVIF: AVIF uses sophisticated transform coding, in-loop directional filtering, and chroma subsampling. These techniques often discard high-frequency pixel information that human eyes cannot perceive. Because PSNR penalizes any mathematical deviation equally, it often assigns poor scores to AVIF images that look virtually indistinguishable from the source to human observers.
- Verdict: PSNR is fast to compute and useful as a baseline during codec development, but it is a poor indicator of true subjective visual fidelity for AVIF.
Structural Similarity Index Measure (SSIM)
SSIM addresses the perceptual shortcomings of PSNR by shifting the focus from absolute pixel error to structural information degradation. It operates on the principle that the human visual system is adapted to extract structural details rather than individual pixel intensities.
- Mechanics: SSIM analyzes local image patches using three comparative components: luminance (brightness), contrast, and structure (cross-correlation). Scores range from -1 to 1, where 1 indicates identical structural fidelity. Variants like Multi-Scale SSIM (MS-SSIM) evaluate the image across multiple resolutions to simulate viewing distance.
- Application to AVIF: AVIF’s in-loop restoration filters and deblocking mechanisms frequently smooth textures at lower bitrates. SSIM captures this loss of edge sharpness and texture structure much better than PSNR. However, SSIM can still over-penalize minor structural shifts introduced by AVIF's transforms that remain visually pleasing or unnoticeable to human eyes.
- Verdict: SSIM (and especially MS-SSIM) offers a balanced, computationally efficient middle ground that correlates moderately well with human perception of AVIF compression artifacts.
Video Multi-Method Assessment Fusion (VMAF)
Originally developed by Netflix for video streaming, VMAF is an advanced perceptual metric that has been adapted to evaluate still image formats like AVIF. VMAF combines multiple quality assessment algorithms and uses a trained machine-learning model (Support Vector Machine) to predict human subjective mean opinion scores (MOS).
- Mechanics: VMAF fuses multiple elementary metrics, primarily the Visual Information Fidelity (VIF), Detail Loss Metric (DLM), and an additive spatial feature metric. It generates a score from 0 to 100, where higher numbers indicate superior fidelity.
- Application to AVIF: Because AVIF is derived from the AV1 video codec, VMAF is uniquely suited to its artifact profile. AVIF artifacts—such as directional blur, edge ringing, and texture smearing at low bitrates—are interpreted by VMAF in a manner that closely mimics human vision. It recognizes when smoothing preserves overall perceptual clarity versus when it destroys essential visual details.
- Verdict: VMAF provides the highest correlation with human visual perception when assessing AVIF compression, making it the industry standard for optimizing AVIF encoding parameters, rate-distortion curves, and quality targets.