The libavif is an open-source library for working with the AVIF image format, providing efficient image compression with support for modern image features. It includes command-line utilities such as avifenc for encoding images and avifdec for decoding and inspecting AVIF files. This tutorial explains how to install libavif utilities on Ubuntu 26.04.
Install libavif Utilities
Ensure that the package lists are up-to-date:
sudo apt update
Install the libavif command-line utilities:
sudo apt install -y libavif-bin
Confirm that both the encoder and decoder utilities are available by checking their versions:
avifenc --version
avifdec --version
Testing libavif Utilities
Download a sample AVIF image for testing:
curl -sSo test.avif https://raw.githubusercontent.com/aomediacodec/libavif/master/tests/data/sofa_grid1x5_420.avif
Inspect the downloaded image with avifdec:
avifdec --info test.avif
The command will display information similar to the following:
Image decoded: test.avif
* Resolution : 1024x770
* Bit Depth : 8
* Format : YUV420
* Chroma Sam. Pos: 0
* Alpha : Absent
* Range : Full
* Color Primaries: 1
* Transfer Char. : 13
* Matrix Coeffs. : 6
* ICC Profile : Absent
* XMP Metadata : Absent
* Exif Metadata : Absent
* Transformations: None
* Progressive : Unavailable
* Gain map : Absent
* 1 timescales per second, 1.00 seconds (1 timescales), 1 frame
* Frame:
* Decoded frame [0] [pts 0.00 (0 timescales)] [duration 1.00 (1 timescales)] [1024x770]
Uninstall libavif Utilities
To completely uninstall libavif utilities and automatically clear dependencies that are no longer required, run this command:
sudo apt purge --autoremove -y libavif-bin
Leave a Comment
Cancel reply