AVIF Support in ImageMagick and Image Tools
This article explores the current state of AVIF (AV1 Image File
Format) support across popular image manipulation tools, with a primary
focus on ImageMagick. It details how these utilities leverage the
reference library, libavif, to enable reading, writing, and
converting this highly efficient next-generation image format, while
also reviewing support in other major tools like GIMP, Sharp, and
libvips.
ImageMagick Support for libavif
ImageMagick provides robust, production-ready support for the AVIF
format. This compatibility is achieved by compiling ImageMagick with the
libavif delegate library (or occasionally
libheif with AVIF enabled).
Verification of Support
To check if your local installation of ImageMagick supports AVIF, run the following command in your terminal:
magick identify -list format | grep -i avifOr for older versions:
convert -list format | grep -i avifIf supported, the output will list AVIF with read/write
permissions (indicated by rw+ or similar flags).
Read and Write Operations
With libavif integrated, ImageMagick can convert
standard images (like JPEG or PNG) to AVIF, and vice versa, using
standard commands:
magick input.png output.avifAdvanced Encoding Controls
ImageMagick exposes several configuration parameters to fine-tune the
AVIF encoding process via the libavif delegate. These can
be adjusted using the -quality flag and specific
-define options:
Compression Quality: The
-qualityflag maps to the quantizer values in libavif. A quality of100translates to lossless encoding, while lower values increase compression.Encoding Speed: You can control the CPU effort versus file size trade-off using the speed setting (typically on a scale of 0 to 10, where 10 is the fastest but least efficient):
magick input.jpg -define heic:speed=6 output.avif
Support in Other Popular Image Tools
Beyond ImageMagick, libavif has been widely adopted
across the open-source and proprietary image manipulation ecosystem.
GIMP (GNU Image Manipulation Program)
GIMP introduced native AVIF support in version 2.10.22. It relies on
libgegl and libavif to allow users to import
and export AVIF files. Upon exporting, GIMP provides a graphical dialog
box where users can configure lossless toggles, adjust compression
quality, select chroma subsampling (e.g., 4:2:0, 4:4:4), and manage
color profiles.
Sharp (Node.js) and libvips
For web developers, Sharp is the leading high-performance Node.js
image processing library. Under the hood, Sharp uses the
libvips image processing library. *
libvips: Native AVIF support is compiled via
libavif or libheif. * Sharp:
Fully supports AVIF out of the box in modern versions. Developers can
programmatically control effort (speed), quality, chroma subsampling,
and lossless configurations directly in their JavaScript pipelines.
Adobe Photoshop
While historically reliant on third-party community plugins to handle AVIF files, Adobe Photoshop now includes native read and write support for AVIF in its recent versions. However, Photoshop’s automation capabilities for bulk AVIF processing remain less flexible compared to command-line utilities like ImageMagick.