AVIF Performance on High-Frequency Noise and Textures
AVIF offers superior compression efficiency compared to legacy image formats, but its handling of high-frequency noise and fine textures requires careful optimization. Derived from the AV1 video codec, AVIF relies on advanced predictive coding and aggressive filtering that inherently favor structural clarity over chaotic micro-details. At medium-to-low bitrates, this typically results in the smoothing or smearing of film grain, foliage, and subtle fabric textures rather than the distinct blocking artifacts common to JPEG. However, through encoder-level fine-tuning and specialized features like Film Grain Synthesis (FGS), AVIF can effectively preserve or reconstruct realistic texture without ballooning file sizes.
The Mechanism Behind Texture Smoothing
AVIF compresses images using spatial prediction, transform blocks, and in-loop filtering. The format utilizes multiple transform types—including various Discrete Cosine Transforms (DCT) and Asymmetric Discrete Sine Transforms (ADST)—to break an image into frequency components.
In this process, high-frequency information (such as digital camera noise, gravel, skin pores, and distant leaves) is assigned small coefficient values. When quantization is applied, these small coefficients are rounded to zero to save bandwidth. Consequently, the high-frequency components are discarded first.
Furthermore, AVIF employs three distinct in-loop filters designed to clean up video compression artifacts:
- Deblocking Filter: Smooths edges across transform and prediction block boundaries.
- Constrained Directional Enhancement Filter (CDEF): Identifies directional edges and applies adaptive low-pass filtering along those edges to eliminate ringing artifacts.
- Loop Restoration Filter: Applies Wiener filtering or self-guided restoration to correct blur and restore degraded edges.
While these filters excel at eliminating ringing and blockiness, they often mistake natural high-frequency noise and subtle textures for unwanted noise, resulting in an overly smooth, "waxy," or "plastic" appearance at lower bitrates.
Behavior on Fine Detail vs. Other Formats
Compared to standard JPEG, which preserves sharp, noisy edges at the cost of noticeable 8x8 pixel block boundaries and mosquito noise, AVIF degrades gracefully. It eliminates hard grid lines, producing clean gradients and sharp contrast edges.
However, when compared to newer formats like JPEG XL, AVIF struggles to natively maintain stochastic (random) high-frequency noise. JPEG XL's adaptive quantization and transform strategies are specifically tailored to still images, often preserving granular texture more naturally at identical file sizes. Unoptimized AVIF files will typically strip fine noise completely before showing any edge breakdown.
Preserving Textures: Tuning and Film Grain Synthesis
To counter aggressive smoothing and retain realistic textures, AVIF
encoders (such as libaom and rav1e) provide
specific flags and tools:
- Film Grain Synthesis (FGS): AVIF includes a native parametric grain engine. Instead of encoding the actual high-frequency noise directly into the bitstream, the encoder strips the grain, estimates its statistical properties (such as intensity and frequency distribution), and transmits these parameters in the metadata. The decoder then procedurally regenerates and overlays the synthetic grain at display time. This creates the visual impression of sharp, textured film without the massive bitrate penalty required to encode raw noise.
- Tuning Metrics: Selecting visual-quality tunings—such as SSIM, butteraugli, or perceptual quality metrics rather than standard Peak Signal-to-Noise Ratio (PSNR)—prevents the encoder from overly penalizing high-frequency fluctuations.
- Disabling or Reducing In-Loop Filters: Encoders allow manual adjustment or disabling of CDEF and loop restoration filters. Lowering filter strength prevents the aggressive blurring of micro-textures, allowing genuine surface details to survive compression.
- Constant Quality (CRF) Thresholds: At sufficiently low CRF values (high bitrates), AVIF retains intact textures without relying on synthetic generation, though the compression size advantage over traditional formats narrows significantly.