This simple tutorial shows how to install the latest version of libheif library, for better HEIF and AVIF image formats support, in Ubuntu 22.04 and/or Ubuntu 20.04 LTS.
Libheif is a popular free open-source library for encoding and decoding HEIF and AVIF. Which, also has partial support for JPEG-in-HEIF, JPEG2000, uncompressed (ISO/IEC 23001-17:2023) capabilities.
It supports libde265
and/or ffmpeg for decoding HEIC images, and x265
/kvazaar
for encoding. For AVIF images, it uses either AOM
/dav1d
for decoding, and AOM
/rav1e
/svt-av1
for encoding support.
As well, it has command line tools to convert HEIF/HEIC to other images, and convert images to HEIF/HEIC.
Many popular applications, including GIMP, Darktable, ImageMagick, Krita, and gThumb, use libheif for HEIF and/or AVIF support. And, the library is usually installed as dependency along with them.
gThumb use libheif for AVIF support
However, libheif in Ubuntu system repositories is always old! While it has 1.6.1
(for 20.04) and 1.12.0
(for 22.04), the latest release is now 1.17.6
and keeps moving.
So, if you want to use the library for new encoders/decoders, improved performances, and bug-fixes. Or, you just run into issue with current version. Then, installing the latest version is a good choice before reporting or asking for help!
And, with the latest release (1.17.6) so far, you’ll get following new features:
heif-convert
to set the PNG compression level,The library has an official Ubuntu PPA, so far support current Ubuntu LTS (22.04 & 20.04) on amd64
(Intel/AMD) and arm64/armhf
(e.g., Raspberry Pi) CPU architecture types.
1. First, press Ctrl+Alt+T key combination on keyboard to open terminal. When it opens, run command to add the PPA:
sudo add-apt-repository ppa:strukturag/libheif
Type user password (no asterisk feedback) when it asks and hit Enter to continue.
2. Then, you can either use Software Updater (Update Manager) to upgrade your current library to the latest:
Or, run command in terminal to install/upgrade it:
sudo apt install libheif1
Linux Mint user need to run sudo apt update
to refresh package cache first.
As you see in last screenshot, there are some encoders/decoders NOT installed by default. Run sudo apt install
plus the package name to install as you want.
At the moment, the plugins (encoder/decoders) include:
There are as well heif-gdk-pixbuf
for image loading, and libheif-examples
package that provides heif-convert
command to convert HEIC/HEIF image to other formats, and heif-enc
to convert image to HEIC/HEIF.
For any issue, you may purge the Ubuntu PPA, so to remove PPA repository, and downgrade all installed packages to the stock versions in system repository.
To do so, first open terminal (Ctrl+Alt+T) and run command to install ppa-purge tool:
sudo apt install ppa-purge
Then, purge the PPA (as well as downgrade packages) via command:
sudo ppa-purge ppa:strukturag/libheif
Tips: the ppa-purge
may fail if you did something to PPA or the installed packages before purging. In the case, try installing synaptic
package manager (from Ubuntu Software), then use it to search & force libheif1
package to old version (select the package, then press Ctrl+E).
The post How to Install Latest libheif to handle HEIF/AVIF in Ubuntu 22.04/20.04 appeared first on Osgrove.
The latest interim release of Ubuntu introduces “devpacks” for popular frameworks like Spring, along with…
Ubuntu 25.04, codenamed “Plucky Puffin”, is here. This release continues Ubuntu’s proud tradition of integrating…
Ubuntu released its 20.04 (Focal Fossa) release 5 years ago, on March 23, 2020. As…
Focal Fossa will reach the End of Standard Support in May 2025, also known as…
Ubuntu MATE 25.04 is ready to soar! 🪽 Celebrating our 10th anniversary as an official…
Welcome to the Ubuntu Weekly Newsletter, Issue 887 for the week of April 6 –…