LinuxCommandLibrary

avifenc

Encode images to AVIF (AV1 Image File Format)

TLDR

Convert a specific PNG image to AVIF

$ avifenc [path/to/input.png] [path/to/output.avif]
copy

Encode with a specific speed (6=default, 0=slowest and 10=fastest)
$ avifenc --speed [2] [path/to/input.png] [path/to/output.avif]
copy

SYNOPSIS

avifenc [options] input.png output.avif

PARAMETERS

--version
    Prints the version information.

-h, --help
    Displays help information.

-q , --quality
    Set the quality level. Range: 0 (best) to 63 (worst). Default: 63.

-s , --speed
    Set the encoding speed. Range: 0 (slowest, best) to 10 (fastest, worst). Default: 6.

--min
    Minimum quantizer. (Similar range than -q)

--max
    Maximum quantizer. (Similar range than -q)

--tiling
    Force explicit tiling (e.g. 32x32).

--tile-rows-log2
    Set the tile rows log2. Range: 0 to 6. Default: determined automatically.

--tile-cols-log2
    Set the tile cols log2. Range: 0 to 6. Default: determined automatically.

--yuv420
    Encode in YUV 4:2:0 chroma subsampling. If the encoder lib supports it.

--yuv422
    Encode in YUV 4:2:2 chroma subsampling. If the encoder lib supports it.

--yuv444
    Encode in YUV 4:4:4 chroma subsampling. If the encoder lib supports it.

--profile
    AVIF profile. 0: Main, 1: High, 2: Professional. Default: 0.

--cicp
    Specify the color information in the format: color_primaries/transfer_characteristics/matrix_coefficients.

--exif
    Specify the Exif metadata file to include.

--icc
    Specify the ICC profile file to include.

--alpha-quality
    Set the quality level for the alpha channel. Range: 0 (best) to 63 (worst). Default: same as -q.

--ignore-icc
    Ignore the ICC profile of the input file.

DESCRIPTION

avifenc is a command-line tool for encoding images into the AVIF (AV1 Image File Format). It takes a source image (typically PNG or JPEG) as input and produces an AVIF file as output. avifenc leverages the AV1 video codec to achieve significantly better compression than JPEG, often with comparable or superior image quality. This tool provides options for controlling encoding speed, quality, and other parameters, allowing users to fine-tune the encoding process for their specific needs.

avifenc is essential for creating modern, high-quality images for the web and other applications where file size is a critical concern. It facilitates the adoption of the AVIF image format, which offers significant bandwidth savings compared to older formats.

CAVEATS

The specific options and their behavior may vary slightly depending on the version of avifenc and the underlying AV1 encoding library used.

PIXEL FORMAT SUPPORT

avifenc typically supports a range of pixel formats, including RGB, RGBA, and YUV. The specific formats supported may depend on the version of the library and the capabilities of the underlying AV1 encoder.

ENCODING TRADE-OFFS

There's a trade-off between encoding speed and image quality. Slower encoding speeds generally result in better compression and higher image quality, while faster speeds may sacrifice some quality for the sake of speed.

HISTORY

avifenc emerged as part of the broader effort to develop and promote the AVIF image format. The AVIF format was created by the Alliance for Open Media (AOMedia), an organization dedicated to developing open, royalty-free media codecs. The tool's development has been closely tied to the evolution of the AV1 video codec and the corresponding AVIF specification. It's been used to encode the image data into avif files for web and other applications.

SEE ALSO

avifdec(1)

Copied to clipboard