avifdec
Decode AVIF images
SYNOPSIS
avifdec [options] <input-file> <output-file>
PARAMETERS
-o <output_filename> or <output-file>
Specifies the output filename. The output format is typically inferred from the file extension.
-q <quality>
Sets the output quality for lossy formats (e.g., JPEG), ranging from 0 (lowest) to 100 (highest).
-d <depth>
Specifies the output bit depth (e.g., 8, 10, 12).
-c <color_profile>
Sets the output color profile (e.g., srgb, hdr, p3).
-f <frame_index>
Decodes a specific frame from an animated AVIF image (0-indexed).
-N
Decodes all frames of an animated AVIF into separate, sequentially numbered files.
--codec <name>
Specifies the AV1 decoder backend to use (e.g., aom, rav1e), if multiple are available.
-v
Enables verbose output, showing decoding progress and details.
-h, --help
Displays the command's help message and exits.
-V, --version
Displays the version information and exits.
DESCRIPTION
avifdec is a command-line utility from the libavif library designed to decode AVIF (AV1 Image File Format) images. It takes an AVIF input file and converts it into a specified output image format, such as PNG, JPG, BMP, PPM, or a Y4M video stream for animated AVIFs.
The tool offers various options to control the decoding process, including output quality, bit depth, color profile, and selection of specific frames for animated sequences. It's an essential utility for developers and users working with AVIF files, providing flexibility for scripting, batch processing, and integration into image workflows.
CAVEATS
Decoding performance can vary significantly based on the complexity of the AVIF image, the chosen AV1 decoder backend, and system resources. Animated AVIFs require specific output handling (e.g., Y4M for video stream or -f/-N for individual frames). Compatibility with all AVIF features may depend on the libavif library version.
OUTPUT FORMATS
avifdec supports various common output image formats, including PNG, JPG, BMP, and PPM. For animated AVIFs, it can output a Y4M video stream. The desired output format is typically determined by the file extension of the specified <output-file>.
ANIMATED AVIF HANDLING
For animated AVIF images, avifdec provides specific options. Users can decode a single frame using the -f <frame_index> option, or decode all frames into separate, sequentially named image files using the -N option. This flexibility is key for processing motion graphics or image sequences.
HISTORY
The avifdec utility is an integral part of the libavif library, which emerged alongside the development and standardization of the AVIF image format. AVIF leverages the highly efficient AV1 video codec for superior image compression, HDR support, and wide color gamut. Developed by AOMedia, libavif and its tools became crucial for adopting and working with this modern image format as it gained traction for its performance advantages over older formats like JPEG.