Best AVIF Settings for Sharp Retro Sprites

Preserving pixel art and retro game sprites in modern image formats requires careful encoder tuning, as traditional lossy compression algorithms tend to blur hard pixel boundaries and smear colors. While AVIF is known for photographic compression efficiency, it can also store crisp, high-contrast 2D art when configured correctly. This guide details the critical AVIF encoder parameters needed to maintain razor-sharp pixel edges, prevent color bleeding, and avoid unwanted smoothing artifacts.

1. Set Chroma Subsampling to 4:4:4 or RGB

The single most damaging default setting for pixel art is chroma subsampling (typically YUV 4:2:0). Subsampling halves the resolution of color information, causing bright pixels to bleed into adjacent dark pixels.

2. Use True Lossless or Near-Lossless Encoding

AV1 relies on transform blocks (such as the Discrete Cosine Transform) to discard imperceptible data. For pixel art, high-frequency edges cannot be discarded without introducing ringing (mosquito noise) around sprites.

3. Disable In-Loop Filtering (Deblocking and CDEF)

AV1 applies multiple filtering passes to smooth out block boundaries and noise in video frames, including the Deblocking Filter, Constrained Directional Enhancement Filter (CDEF), and Loop Restoration. When applied to sprites, these filters mistakenly recognize sharp pixel grids as compression artifacts and blur them.

4. Enable Transform Block Partitioning Down to Small Sizes

Modern encoders default to large transform blocks (up to 64x64 or 128x128) to compress flat areas efficiently. For complex pixel arrangements, the encoder must be allowed to split blocks down to 4x4 pixels to capture intricate sprite details.

5. Set Full Color Range

Video standards often compress luminance values to standard broadcast ranges (16–235), crushing the dynamic range of retro graphics.