71

How can I view .HEIC photos (the new default format on iOS 11) on a Linux desktop, without uploading them to some cloud service? Is there an image viewer, image converter, or browser with support for .HEIC, either released or not-yet-released?

Ivan Kozik
  • 987
  • 1
  • 6
  • 15
  • 3
    Another discussion is at https://askubuntu.com/questions/958355/any-app-on-ubuntu-to-open-heif-heic-high-efficiency-image-file-format-pictur – mdeff May 30 '19 at 19:52

13 Answers13

46

On Ubuntu (Debian distro) the easiest way is probably to run:

sudo apt install heif-gdk-pixbuf

For Fedora and other RPM-based distros use:

sudo dnf install libheif

After this, e.g. Eye of Gnome eog image.heic will display your image.

Aulis Ronkainen
  • 2,612
  • 42
  • 29
  • 27
colin
  • 561
  • 1
  • 4
  • 3
26

to convert a heic image to be able to view it as usual,

sudo apt-get install libheif-examples

then convert image to jpg:

heif-convert input.heic output.jpg

then view the image using any image viewer - here's an example:

ristretto  output.jpg
jmarina
  • 377
  • 3
  • 4
  • 3
    The heif-convert step worked. Not sure what 'ristretto' is? – Elliptical view Aug 25 '21 at 14:21
  • @Ellipticalview [Ristretto Image Viewer](https://docs.xfce.org/apps/ristretto/start) – Darren Ng Sep 01 '21 at 13:07
  • Any image viewer wold work: mentioning a specific one as part of the solution workflow the way you did is out of the scope of the question, so it looks like an advertisement... – Francesco Potortì Feb 02 '22 at 11:53
  • 1
    @FrancescoPotortì the answer is now updated to explicitly state that any image viewer would work; I used ristretto as an example because it was already installed – jmarina Feb 04 '22 at 11:43
  • 4
    For all files in directory: `for i in *.HEIC; do heif-convert "$i" "$i.jpg"; done` – fracz Mar 07 '22 at 12:01
  • 1
    Like @fracz but without the "file.HEIC.jpg" double extension: `for i in *.HEIC; do heif-convert "$i" "${i%.HEIC}.jpg"; done` – qneill Apr 22 '22 at 19:04
  • for those on rpm-based systems such as Fedora: the package providing `heif-convert` is `libheif-tools`. – antiplex May 31 '23 at 15:35
18

For local conversion, this worked for me in Debian. Just downloaded the static build, ran the example conversion command, everything worked:

https://github.com/monostream/tifig

s0kr8s
  • 312
  • 2
  • 3
  • Yes, 0.2.0 runs on Ubuntu 18. https://github.com/monostream/tifig/releases/download/0.2.0/tifig-static-0.2.0.tar.gz – Camille Goudeseune Jan 17 '21 at 18:44
  • v0.2.2 works great as a static download on Ubuntu 20.04 as wel – onetwopunch May 19 '21 at 16:33
  • 1
    At the time of writing, this no longer works with photos from newer iOS versions. You will get the error message: "Grid configuration not found! tifig currently only supports .heic images created on iOS 11 devices." – Walf Jun 11 '21 at 02:44
8

For the record, ImageMagick supports it. Somehow magick display image.heic gave me weird results, but converting was fine:

magick convert image.heic image.jpg
JonasVautherin
  • 219
  • 3
  • 5
  • 2
    On Debian 10.3 I have to use `convert-im6.q16` rather than `magick`. (From 'imagemagick' package v 8:6.9.10.23+..). (Also GIMP opens them, but it's more awkward and much more slow.) Thanks! – Elliptical view Apr 19 '20 at 00:10
7

.heic may be the file name extension, but the format is more commonly known as HEIF, the High Efficiency Image File format. There’s an open source implementation from Nokia here: http://nokiatech.github.io/heif/

Giacomo1968
  • 53,069
  • 19
  • 162
  • 212
Spiff
  • 101,729
  • 17
  • 175
  • 229
4

You could convert it to a supported format using ffmpeg:

ffmpeg -i image.heic image.png
gargoylebident
  • 241
  • 4
  • 14
  • Apparently ffmpeg [does not yet support HEIF](https://trac.ffmpeg.org/ticket/6521)? – jchook Feb 13 '21 at 23:16
  • Just took a photo on an iPhone and ran the .heic file through ffmpeg with the above command. Converted to png without any problems. Not sure why the people in that post are having issues. – gargoylebident Feb 17 '21 at 03:53
  • Not working for me. I'm seeing: $ ffmpeg -i IMG_9256.heic IMG_9256.png ffmpeg version 4.1.6-1~deb10u1 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 8 (Debian 8.3.0-6) configuration: --prefix=/usr --extra-version='1~deb10u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdi – Elliptical view Aug 25 '21 at 14:08
  • o --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq – Elliptical view Aug 25 '21 at 14:09
  • --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat 58. 20.100 / 58. 20.100 libavdevice 58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc 55. 3.100 / 55. 3.100 – Elliptical view Aug 25 '21 at 14:10
  • 2
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a711614740] moov atom not found IMG_9256.heic: Invalid data found when processing input – Elliptical view Aug 25 '21 at 14:10
  • 2
    I am also getting "moov atom not found" with FFmpeg 4.4.2 on Ubuntu 22.04 – Derkades Jul 30 '22 at 15:55
2

GIMP 2.10.8 installs the library libheif1 to open HEIC images, other linux programs can be expected to follow soon.

db-inf
  • 141
  • 4
2
  1. Remove previous version of ImageMagick:

    sudo apt-get remove imagemagick
    
  2. Install base dependencies:

    sudo apt-get install build-essential checkinstall 
    sudo apt-get install libx11-dev libxext-dev zlib1g-dev libpng12-dev libjpeg-dev libfreetype6-dev libxml2-dev
    sudo apt-get install libwebp-dev libde265-dev
    
  3. Install library for reading HEIF/HEIC files (this step is essential):

    cd /usr/src/
    sudo wget https://github.com/strukturag/libheif/archive/v1.3.2.tar.gz
    sudo tar -xvf v1.3.2.tar.gz
    sudo rm v1.3.2.tar.gz
    cd libheif-1.3.2/
    sudo ./autogen.sh
    sudo ./configure
    sudo make
    sudo make install
    
  4. Install ImageMagick with WEBP and HEIC support:

    cd /usr/src/
    sudo wget http://www.imagemagick.org/download/ImageMagick.tar.gz
    sudo tar xvzf ImageMagick.tar.gz
    sudo rm ImageMagick.tar.gz
    cd ImageMagick-7.0.10-31/
    sudo ./configure --with-heic=yes --with-webp=yes
    sudo make
    sudo make install
    sudo ldconfig /usr/local/lib
    sudo make check
    
  5. Check version:

    convert --version
    ...
    Version: ImageMagick 7.0.10-31 Q16 x86_64 2020-10-03 https://imagemagick.org
    Copyright: © 1999-2020 ImageMagick Studio LLC
    License: https://imagemagick.org/script/license.php
    Features: Cipher DPC HDRI OpenMP(4.0) 
    Delegates (built-in): bzlib fontconfig freetype heic jbig jng jpeg lcms lzma openexr pangocairo png tiff webp wmf x xml zlib
    
  6. As you see 'heic' is in the delegates list.

  7. To convert single file from HEIC into JPG:

    convert IMG_3288.HEIC IMG_3288.jpg
    
  8. To convert all HEIC-files in current directory into JPEG:

    ls *.HEIC -1 | sed -e 's/\.HEIC$//' | xargs -I {} convert {}.HEIC {}.jpeg
    

Usefull links:

https://medium.com/@sanjaywrites/install-latest-version-of-imagemagick-in-ubuntu-16-04-c406ddea1973 https://gist.github.com/rjnienaber/af47fccb8410926ba7ea35f96c3b87fd

Giacomo1968
  • 53,069
  • 19
  • 162
  • 212
Ukr
  • 121
  • 2
  • 1
    `for img in *{heic,HEIC}; do convert "${img}"{,.jpg}; done` (Not sure how portable it is though, and it does just append the JPEG extension at the end - although I like converting like that as it gives a sense of "format history".) – toraritte Jul 25 '21 at 12:29
  • I woud refrain from installing archives from an unknown GitHub repo - can contain anything. – Ondra Žižka Mar 11 '22 at 12:55
  • Both HEIC and JPEG formats are lossy, which means quality losses, when converting from HEIC to JPEG, hence, I don't think, that this approach is right overall! – Exterminator13 Jun 13 '23 at 12:55
  • `sudo snap install regardsviewer` works for me, unfortunately, I can't write the answer due to not enough reputation rate. – Exterminator13 Jun 13 '23 at 12:59
2

Just in case any openSUSE user finds this.

Add the Packman repo and then:

# zypper in libheif1 gdk-pixbuf-loader-libheif gimp-plugin-heif

After that, I was able to open .HEIC photos using GIMP.

Antônio Medeiros
  • 194
  • 1
  • 1
  • 7
1

I realize this is a little old but since these posts I've found a Gimp plugin and even a QT plugin for KDE support. Hope these help someone in the future.

sudo dnf install gimp-heif-plugin qt-heif-image-plugin
Giacomo1968
  • 53,069
  • 19
  • 162
  • 212
BoeroBoy
  • 149
  • 4
  • 1
    `sudo snap install regardsviewer` supports HEIC. IMHO, it's better to find one dedicated image viewer for this naughty image format, than try to install plugins, as in my case such packages are not even present! – Exterminator13 Jun 13 '23 at 13:04
1

Debian:

apt install viewnior heif-gdk-pixbuf
viewnior file.heic

or

apt install gpicview heif-gdk-pixbuf
gpicview file.heic
Dan Jacobson
  • 141
  • 5
0

I'm on Fedora 33 and I'm unable to edit a .HEIC image using neither convert (ImageMagick 6.9.11.27), ffmpeg 4.3.3, GIMP 2.10.24, nor Inkscape 1.0.2.

The only app that does the job for me is Shutter 0.99.1.

yurloc
  • 101
  • 1
0

As mentioned above, you need libheif in fc33. dnf install libheif and eog

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 19 '21 at 07:36