access to .heic image files
Hi all,
It looks like recent iPhones now produce photos with a new encoding (HEIF, stored in HEIC containers) instead of the well-known JPEG... I have found and used a nice (and currently free) online converter at https://heictojpg.com/ I am looking for a command line tool (or at least a library) which allows me to convert a batch of .heic files to jpeg. Any suggestion? TIA Phil |
I just went through this exercise recently and did not have much luck. Although Imagemagick states on their web site that it supports HEIC it didn't work. I gave up since it was less work for someone with a Mac to convert the files for me. I don't have a IPhone but would probably set the default to jpeg just so you don't mess with conversion.
|
I don't have any HEIF images to test with, but I did find these few projects that might do it.
https://github.com/monostream/tifig - requires ffmpeg 3.1+ and libvips 8.6+. SBo has ffmpeg 3.2.4 but only libvips 8.1, so you may be able to manually use a newer version of libvips. https://github.com/ImageMagick/ImageMagick/ - According to the changelog, v7 should have it from v7.0.7-22+ and v6 should have it from v6.9.9-34. https://github.com/pushd/heif - According to the readme, it requires ffmpeg and imagemagick, however, it doesn't state what versions of each. |
Thanks, michaelk and bassmadrigal, for your answers. I think that ImageMagick is the best bet.
I built the last github version with configure option '--with-heic'. Libde265 must be installed, or ImageMagick configure builds with no heic support. so I built and installed the last version at https://github.com/strukturag/libde265. Now, ImageMagick says it builds with HEIC. - when I run './magick --version', it lists heic in the built-in delegates list. Code:
./magick --version 'convert zz.heic zz.jpeg' does convert to a jpeg image. (woohoo!) 'convert zz.jpeg zz2.heic' fails with message "no encode delegate for this image format `HEIC'" So maybe I missed something to also allow HEIC encoding... but for the moment, I don't care. I think that for many of us, the HEIC to JPEG conversion is much more useful! Hope it helps some of you with the same issue (and I sure hope the next Slackware will include libde265 and ImageMagick with heic support) Phil |
libde265
Quote:
This is a simple problem somebody who knows more about the pkg-config utility and libde265 can probably answer? Help needed here please. |
libde265
Just an update for others --- I did get libde265 properly installed. The "trick" was to ignore the instructions in the README.md file about using cmake to generate the make in a 'build' subdirectory; if you do it this way, you'll run into my problem of there being no 'install' operation in the Makefile. Instead, I just used the Makefile that was in the main directory, it built somewhat differently there but there also is an 'install' action in that Makefile.
Once libde265 is installed, the ImageMagick configure enables support for heic file format and it all works as was described. I let it install both libde265.so and ImageMagick into /usr/local, though I'm told they more appropriately belong in /opt. Whatever... I just also had to add /usr/local/lib into my LD_LIBRARY_PATH for magick to find the shared library. Also, Ubuntu actually includes an ImageMagick package in its repositories, but it is ImageMagick 6 and does not have HEIC built-in. That package is also used as a dependency by CUPS for printer services, however, so I had keep that installed too! Finally, I'd mention that not all HEIC converters are the same. Some strip the image information headers with things like the date/time take and geolocation, and file size of the resulting JPG seem to vary (I guess that's a compression quality issue?) I think everyone has to get with the program, GIF BMP JPG have a new sibling HEIC that needs to be universally adopted; the time has come ... |
Quote:
Quote:
Then before ./configuring ImageMagick, I just hand-copied the libde265.so files in a system dir --Not as clean as your /usr/local complete install, but it did the job! :) |
Quote:
|
If you have a newer iPhone, you have the format automatically converted to .jpg on export:
http://osxdaily.com/2017/09/29/chang...mat-jpeg-heif/ |
Quote:
|
Quote:
|
I'm trying to do this on Amazon Linux (I'm building Imagemagick for AWS Lambda), but am having trouble at the `configure` stage.
I'm Installing libde265 from the github source, copying the libde265.so, .a, .la files to /usr/lib64 and libde265.pc file to /usr/lib64/pkgconfig as mentioned above, and configuring Imagemagick with the --with-heic flag, but I still don't get the HEIC delegate in the config output. Any ideas about steps I'm missing or options I'm leaving out? I've been stumped for a week. This is my whole setup process: Quote:
|
Quote:
Quote:
I've succeffuly built ImageMagic on Mac and Linux Version: ImageMagick 7.0.7-33 Q16 x86_64 2018-05-18 https://www.imagemagick.org Copyright: © 1999-2018 ImageMagick Studio LLC License: https://www.imagemagick.org/script/license.php Features: Cipher DPC HDRI Modules Delegates (built-in): bzlib freetype heic jng jpeg ltdl lzma png tiff xml zlib But bear in mind that ImageMagic has far from superior heic->jpeg conversion algorithm, resulting images have a lot of artefacts, you can check image quality via service https://heic2jpeg.com/ |
I stumbled upon this issue yesterday when I wanted to crop&convert some pictures imported from iPhone device. Based on information in this thread and Internet sources I created few slackbuild scripts. If anyone is interested the url is click. I plan to submit libraries to SlackBuilds.org eventually.
Please note that the heic gimp plugin is only meant for gimp < 2.10. Version included in current has it out of the box. |
Any improvements to heic in linux?
Gimp, ffmpeg, magick on my Clear Linux still fail to be usable.
Any other non-building type solutions? |
All times are GMT -5. The time now is 07:27 PM. |