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.
Ubuntu now runs natively on the Thundercomm RUBIK Pi 3 developer board – a lightweight…
Validate your skills and advance your career with recognized qualifications from the publishers of Ubuntu…
This article demonstrates how to deploy Poweradmin to manage PowerDNS on Ubuntu VPS server. What…
This article provides an outline for self-hosting Easypanel and n8n on Ubuntu VPS. What is…
Install a well-known model like DeepSeek R1 or Qwen 2.5 VL with a single command,…
October 23, 2025 – Today, ESWIN Computing and Canonical announced the pre-installation of Ubuntu on…