Converting picture to AVIF

Format AVIF is open-sourced and royalty free optimised image format. AVIF offers significant file size reduction compared with JPEG, PNG and WebP. AVIF is 30% smaller than WebP and 50% smaller than JPEG.

AVIF is based on AV1 video codec created by Alliance for Open Media. It’s supported by major browsers and major multimedia manipulation programs FFmpeg and ImageMagick.

FFmpeg conversion

After some testing, I found that SVT-AV1 library works the best. Not only it produces higher quality but its also faster. Quality crf 27 is needed to fully avoid color banding.

Command line

Lower preset means slower, more efficient and possibly better looking encoding. Lower crf means larger output file size and more details.

-c:v libsvtav1 -crf 27 -pix_fmt yuv420p10le -preset 4