Linux heic to jpg

Any app on Ubuntu to open and/or convert HEIF pictures (.HEIC, High Efficiency Image File Format)?

A certain cellphone maker has changed the default format of taking pictures to HEIF (.HEIC, High Efficiency Image File Format), without asking the users (although there is still the option to use jpeg/jpg). Is there an app/program on Ubuntu that can open and/or convert HEIF-pictures and even let them be edited?

For background, note: Introduced in 2015, HEIF was adopted by Apple in 2017 with the introduction of iOS 11, and read about how Apple’s introduction of this feature, combined with online exams due to COVID, led to students failing AP exams in 2020: en.wikipedia.org/wiki/High_Efficiency_Image_File_Format

6 Answers 6

In recent Ubuntu versions (>= 18.04):

sudo apt-get install libheif-examples 
for file in *.heic; do heif-convert $file $; done 

In older Ubuntu or Mint versions, first add this PPA and then do the above steps.

sudo add-apt-repository ppa:strukturag/libheif sudo apt-get update 

1) This is an official package of 18.04 (packages.ubuntu.com/bionic/libheif-examples) and 2) I had to change .heic to .HEIC in both places since mine were capitalized. Thank you!! This worked so well!

Thanks for this post, it was helpful! A small note that might help someone else: I’m not that familiar with Bash and terminal scripting and it took me more than 30 minutes to figure out that pasting this command caused the error Input file is not an HEIF file because my files had UPPER case extension HEIC and the command used lower-case..

This answer won’t work with files with spaces/newlines in their names. This version would work: for file in *.HEIC; do heif-convert «$file» «$«; done

Don’t forget to specify JPEG quality and quote the parameters if there are any spaces or other special characters in the file names: for file in *.heic; do heif-convert -q 97 «$file» «$«; done

Ubuntu 22.04 quick start

  • install heif-gdk-pixbuf for support in at least eog (Eye of GNOME, GNOME Image Viewer).
  • install heif-thumbnailer for file manager (nautilus, nemo) thumbnails.
  • The available versions of Geeqie, ImageMagick, gThumb and many more (see below) have built-in support.

Official packages

Starting with Ubuntu 20.04: At least for eog (Eye of GNOME, GNOME Image Viewer), you have to install the package heif-gdk-pixbuf (no PPA needed). In a terminal run:

sudo apt install heif-gdk-pixbuf 

This will install libheif1 and libde265-0 along.

Apparently KDE distros with KDE Frameworks 5.80 have added support for HEIF and HEIC Image Formats to all KDE Apps (news, KDE announcement, MR), but the support flag is not enabled yet in the default (K)ubuntu packages (ubuntu bug).

Читайте также:  Linux kernel load drivers

Programs/Apps that support HEIF via libheif1 include:

  • GNOME Image Viewer (Eye of GNOME — eog) is updated in Ubuntu 19.10 and later. (Thanks seanlano!) — if it does not work for you, see PPA tip below.
  • 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 (0.2.5+), can be installed from the Software Center or directly from the project page. Thank you, adasiko.
  • digiKam (6.4+)
  • GIMP (2.10.2+)
  • Krita (4.2+)
  • gImageReader (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
  • Shotwell (0.32+)
  • 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 and heif-enc .

Programs/Apps to CONVERT HEIF/HEIC-pictures:
Most of the above mentioned apps support to convert a HEIC-photo, e.g. eog (Eye of GNOME, GIMP, Krita, GPicView.
Open the photo via one of these image viewer/editor, then select Export to JPG (or another image format like PNG) or Save as (choose a different image format then HEIC).

For batch conversion on the command-line, use heif-convert or ImageMagick’s convert .

Unofficial Packages and older Ubuntu versions

If one is willing to install a Flatpak, Snap app, or PPA:

sudo add-apt-repository ppa:strukturag/libheif 
sudo apt install heif-gdk-pixbuf 
sudo add-apt-repository ppa:ubuntuhandbook1/apps sudo apt update sudo apt install gthumb 

Ubuntu 19.10
There are some prominent bugs in the shipped version of libheif1 , so update to the latest version available from the PPA libheif by “struktur AG” team:
In a terminal: sudo add-apt-repository ppa:strukturag/libheif

Upgrade of packages (Sept 2020)
You also need to add the PPA strukturag/libde265 to get the correct dependencies:

sudo add-apt-repository ppa:strukturag/libde265 sudo apt update sudo apt upgrade 

(If you get the error add-apt-repository: not found , make sure software-properties-common is installed, e.g. sudo apt install software-properties-common)

Those who do not wish to install a PPA may download the packages directly from the PPA webpages to install ( dpkg -i ) or recompile. Packages installed this way will not be automatically updated.

Online Tools

  • Google Photos and Dropbox both support HEIF.
  • There are other online converters (e.g. HEICtoJPEG), but check their privacy policies before use.

Miscellaneous

  • ImageMagick, as of 7.0.7-22, can be compiled with the —with-libheif flag. One-liner build with IMEI. (The pre-built AppImage does not support heic yet.)
  • tifig is described as «a fast HEIF image converter aimed at thumbnailing». However, it must currently be compiled from source.
  • Nokia HEIF Info and Source Code. However, Apple’s implementation differs somewhat.
  • Windows 10 Build 17623 includes support for HEIF in the Photos app. However, the following may need to be installed before use:
    • HEIF Image Extensions
    • HEVC Video Extensions or HEVC Video Extensions from Device Manufacturer

    Not sure what the proper etiquette to mention this is (maybe I should edit instead of comment?), but I created a Qt image plugin that wraps libheif. I would like to create a PPA, but that hasn’t happened yet.

    I’m using Ubuntu 19.10, and I was able to open a HEIF image in «Image Viewer» without needing to do anything special – no extra PPAs

    Huh, I tried again today and this time it’s working, even though I just repeated the same eog command in the same terminal as yesterday. Ah well, it works now, thank you for your patience with my weird problems!

    On Ubuntu 20.04 Focal Fossa:

    $ sudo apt install heif-gdk-pixbuf heif-thumbnailer gimagereader gpicview 

    example of setting the HEIF MIME type

    then find an HEIC file in the file manager, right click, select Properties then Open With and select Image Viewer (if there’s two of them, select the one with the more colourful icon) and then select Set as default (or Add if that’s the only option.)

    After that you can double-click HEIF files to view them:

    example of an HEIF image opened from the file manager

    Older Ubuntu LTS:

    On Ubuntu 18.04 you can sudo snap install gimp to get the latest version (2.10.10 8 as of May 2019) which can open and edit HEIC files.

    On Ubuntu 18.04 there’s also a commandline tool to convert HEIC:

    sudo apt install libheif-examples heif-convert IMG_1605.HEIC IMG_1605.jpg 

    NOTE: you must use lowercase .jpg or it will complain that it doesn’t recognise the file format. That message is almost as misleading as the package name, and I can easily understand given these two papercuts why so few people have figured out how to use this tool.

    user@host:~/Desktop$ dpkg -s libheif-examples Package: libheif-examples Status: install ok installed Priority: optional Section: video Installed-Size: 91 Maintainer: Ubuntu Developers Architecture: amd64 Source: libheif Version: 1.1.0-2 Depends: libheif1 (= 1.1.0-2), libc6 (>= 2.14), libgcc1 (>= 1:3.0), libjpeg8 (>= 8c), libpng16-16 (>= 1.6.2-1), libstdc++6 (>= 5.2) Description: ISO/IEC 23008-12:2017 HEIF file format decoder - examples libheif is an ISO/IEC 23008-12:2017 HEIF file format decoder. HEIF is a new image file format employing HEVC (h.265) image coding for the best compression ratios currently possible. . Sample applications using libheif are provided by this package. Original-Maintainer: Debian Multimedia Maintainers Homepage: http://www.libheif.org 

    OK so now the punchline of this joke. 😉

    You can use fuseflt or yacufs FUSE filesystems to mount your pictures folder with automated temporary cached conversion of your HEIC files so all the stock Linux desktop apps can open the HEIC files without ever knowing they’re doing it.

    Mark Deven below says that he only needed to install libheif via aptitude to get these commands, though he didn’t mention what distro he’s running.

    Источник

    How to Open or Convert iOS HEIC Photos to JPEG and PNG in Ubuntu 20.04 | 22.04

    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 and heif-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 $; done

    Источник

Оцените статью
Adblock
detector