As you might already know, the HEIF was adopted by Apple in 2017 with the introduction of iOS 11. This image format doesn’t always work when you want to upload it to many websites or open on your Ubuntu Desktop.
What is the HEIC Format?
HEIC which stands for High-Efficiency Image File Container (in HEIF, “F” stands for format). It is a container format for an individual image and specific image sequences. HEIF is empowered by high-efficiency video compression (HEVC) codec and is also called h.265.
HEIF and HEVC are both developed by MPEG or Moving Picture Experts Group. According to the statistics of storage, Apple claims that HEIF with HEVC requires half of the storage with the quality like JPEG.
One of the big advantes of the format is that it supports animation and works well to store more information compared to any animated GIF or APG. Apple uses this format for thier interactive dynamic wallpapers.
In this tutorial, you’ll see how to convert HEIF images to JPG or PNG with Linux commands. If you would like to open HEIC files directly, the latest available versions of Geeqie, ImageMagick, gThumb and many more (see below) have built-in support.
Apps that support HEIF via libheif1
natively:
- GNOME PPAImage Viewer (Eye of GNOME – eog) is updated in Ubuntu 19.10 and later.
- gThumb Image Viewer & Organizer ≥3.11.4, in ≥ Ubuntu 22.04 (for older verstions see below)
- Darktable, free open source photography application and raw developer (3.8+)
- GPicView (at least version 0.2.5-3), can be installed from the Software Center or directly from the project page
- digiKam (6.4+)
- GIMP (2.10.2+)
- Krita)
- gImageReader (in Ubuntu 20.04)
- Kodi (free and open-source media player software application) with Add-on:HEIF image decoder
- xviewer (based on Eye of GNOME) with heif-gdk-pixbuf
- Geeqie (1.6) in ≥ Ubuntu 22.04
heif-thumbnailer
– a thumbnailer for HEIF images that can be used by Nautilus and Nemo.libheif-examples
– provides command-line utilities:heif-convert
andheif-enc
.
Convert HEIF images to JPG or PNG
On Ubuntu, you can simply install a command-line tool called heif-convert. To use it, simply install the libheif-examples command-line. heif-convert just comes with it for free. To install, run the following command:
sudo apt-get install libheif-examples
You can easily convert your HEIC file with the following command:
heif-convert [original-file-name] [file-name-with-jpg-or-png-extension]
For example, if you have a file called IMG_1234.HEIC and want to convert it to IMG_1234.jpg, you can simply run:
heif-convert IMG_1234.HEIC IMG_1234.jpg
To convert a bunch of HEIC Photos at the same time the script below are interate over a list of pictures in a folder to accomplish that:
for file in *.heic; do heif-convert $file ${file/%.heic/.jpg}; done
Discussion about this post