Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1] 2

Author Topic: High Efficiency Image File Format (HEIC)  (Read 8040 times)

tickmike

  • Kitizen
  • ****
  • Posts: 3640
  • Yes Another Penguin !. :)
High Efficiency Image File Format (HEIC)
« on: February 10, 2021, 08:56:52 PM »

My Daughter has downloaded hundreds of Photo's (HEIC) format files to her Linux laptop from her iPhone  mixed with other JPG photo files in her Picture Directory.

Without going through each one to covert it to view it she wants to know how can they all be converted in one go to JPG ?.

Logged
I have a set of 6 fixed IP's From  Eclipse  isp.BT ADSL2(G992.3) line>HG612 as a Modem, Bridge, WAN Not Bound to LAN1 or 2 + Also have FTTP (G.984) No One isp Fixed IP >Dual WAN pfSense (Hardware Firewall and routing).> Two WAN's, Ethernet LAN, DMZ LAN, Zyxel GS1100-24 Switch.

burakkucat

  • Respected
  • Senior Kitizen
  • *
  • Posts: 38300
  • Over the Rainbow Bridge
    • The ELRepo Project
Re: High Efficiency Image File Format (HEIC)
« Reply #1 on: February 10, 2021, 10:16:56 PM »

If you know how to manually convert a HEIC format file to a JPEG format file (I don't) then it should be quite simple. Something like --

for I in $(ls -1 *.HEIC)
do convert $I
done

Where convert is the relevant utility to perform the conversion.
Logged
:cat:  100% Linux and, previously, Unix. Co-founder of the ELRepo Project.

Please consider making a donation to support the running of this site.

Alex Atkin UK

  • Addicted Kitizen
  • *****
  • Posts: 5260
    • Thinkbroadband Quality Monitors
Re: High Efficiency Image File Format (HEIC)
« Reply #2 on: February 10, 2021, 10:43:26 PM »

If you know how to manually convert a HEIC format file to a JPEG format file (I don't) then it should be quite simple. Something like --

for I in $(ls -1 *.HEIC)
do convert $I
done

Where convert is the relevant utility to perform the conversion.

Ironically ImageMagick has a command called convert, so that's more or less correct.

Install ImageMagick and awk (probably already installed) from the package manager then create a script containing the following:
Code: [Select]
#!/bin/bash
for file in $(ls *.HEIC | awk '{ print substr($1,1,length($1)-5); }')
do
    convert -quality 96 $file.HEIC $file.jpg
done

Remember Linux is case sensitive so if the extension is in lower-case then replace HEIC both times above with it in lower-case.
You may also want to tweak the quality of the output image, I think that option is kinda obvious.
« Last Edit: February 10, 2021, 10:51:37 PM by Alex Atkin UK »
Logged
Broadband: Zen Full Fibre 900 + Three 5G Routers: pfSense (Intel N100) + Huawei CPE Pro 2 H122-373 WiFi: Zyxel NWA210AX
Switches: Netgear MS510TXUP, Netgear MS510TXPP, Netgear GS110EMX My Broadband History & Ping Monitors

petef

  • Reg Member
  • ***
  • Posts: 135
Re: High Efficiency Image File Format (HEIC)
« Reply #3 on: February 10, 2021, 11:38:53 PM »

The extra ls and awk can be done in bash. The double quotation marks allow for spaces in the filenames.

for f in *.HEIC; do convert "$f" -quality 96 "${f%.HEIC}.jpg"; done
Logged

Alex Atkin UK

  • Addicted Kitizen
  • *****
  • Posts: 5260
    • Thinkbroadband Quality Monitors
Re: High Efficiency Image File Format (HEIC)
« Reply #4 on: February 11, 2021, 01:39:13 PM »

The extra ls and awk can be done in bash. The double quotation marks allow for spaces in the filenames.

for f in *.HEIC; do convert "$f" -quality 96 "${f%.HEIC}.jpg"; done


Thanks, I knew that was possible but I couldn't remember the specifics.
Logged
Broadband: Zen Full Fibre 900 + Three 5G Routers: pfSense (Intel N100) + Huawei CPE Pro 2 H122-373 WiFi: Zyxel NWA210AX
Switches: Netgear MS510TXUP, Netgear MS510TXPP, Netgear GS110EMX My Broadband History & Ping Monitors

broadstairs

  • Kitizen
  • ****
  • Posts: 3697
Re: High Efficiency Image File Format (HEIC)
« Reply #5 on: February 11, 2021, 04:09:50 PM »

If your daughter needs a tool with a gui then I can recommend digikam which is a photo management program and will convert these files, it has a batch tool which should do it. As long as all the relevant libraries are installed of course  ::)

Stuart
Logged
ISP:Vodafone Router:Vodafone Wi-Fi hub FTTP

tickmike

  • Kitizen
  • ****
  • Posts: 3640
  • Yes Another Penguin !. :)
Re: High Efficiency Image File Format (HEIC)
« Reply #6 on: February 12, 2021, 04:34:41 PM »

Thanks all.
What I plan to do as my Daughter lives 160 miles away, her laptop is backed up to my server so once that has been done to extract some of these HEIC files along with a typical mix of her photo directory then put them on my spare laptop and have a play to see what will be the best way for her (or me over 'teamviewer' ) to batch convert them.

@ broadstairs re 'digikam'
Yes that's already installed as with 'GIMP' and 'Gwenview'.
So yes that might be the way forwards as long as they can do them in bulk.
I know she as been using 'GIMP' to convert the odd photo but there are hundreds to convert.
Logged
I have a set of 6 fixed IP's From  Eclipse  isp.BT ADSL2(G992.3) line>HG612 as a Modem, Bridge, WAN Not Bound to LAN1 or 2 + Also have FTTP (G.984) No One isp Fixed IP >Dual WAN pfSense (Hardware Firewall and routing).> Two WAN's, Ethernet LAN, DMZ LAN, Zyxel GS1100-24 Switch.

Alex Atkin UK

  • Addicted Kitizen
  • *****
  • Posts: 5260
    • Thinkbroadband Quality Monitors
Re: High Efficiency Image File Format (HEIC)
« Reply #7 on: February 12, 2021, 05:14:05 PM »

I always use batch files as its quicker than GUI where you usually have to click on each one, especially if its spread across multiple folders you can just make a bash alias to the script.  Plus its just plain more reliable.
Logged
Broadband: Zen Full Fibre 900 + Three 5G Routers: pfSense (Intel N100) + Huawei CPE Pro 2 H122-373 WiFi: Zyxel NWA210AX
Switches: Netgear MS510TXUP, Netgear MS510TXPP, Netgear GS110EMX My Broadband History & Ping Monitors

broadstairs

  • Kitizen
  • ****
  • Posts: 3697
Re: High Efficiency Image File Format (HEIC)
« Reply #8 on: February 12, 2021, 08:15:25 PM »

Digikam has quite a good batch process where you can give it a pattern to select with. I grant you if you are familiar with the CLI then its fine but if not the extra time using a gui can be safer  ;)

Stuart
Logged
ISP:Vodafone Router:Vodafone Wi-Fi hub FTTP

tickmike

  • Kitizen
  • ****
  • Posts: 3640
  • Yes Another Penguin !. :)
Re: High Efficiency Image File Format (HEIC)
« Reply #9 on: February 12, 2021, 09:33:27 PM »

First test, I have placed one heic photo in a test directory, opened 'Konsole' in that directory and tried your scrips, both have the same output.


$ #!/bin/bash
for file in $(ls *.heic | awk '{ print substr($1,1,length($1)-5); }')
do
    convert -quality 96 $file.heic $file.jpg
done
convert: no decode delegate for this image format `HEIC' @ error/constitute.c/ReadImage/504.
convert: no images defined `2021-01-02_12-25-13_324.jpg' @ error/convert.c/ConvertImageCommand/3258.


$  #!/bin/bash
for f in *.heic; do convert "$f" -quality 96 "${f%.heic}.jpg"; done
convert: no decode delegate for this image format `HEIC' @ error/constitute.c/ReadImage/504.
convert: no images defined `2021-01-02_12-25-13_324.jpg' @ error/convert.c/ConvertImageCommand/3258

ImageMagick is already installed on this spare laptop.
I also tried opening the test photo with 'ImageMagick' and that also gave error message of  ''no decode delegate for this image format''


I do not know what I'm doing with konsole and scrips.   Help. :hmm:
Logged
I have a set of 6 fixed IP's From  Eclipse  isp.BT ADSL2(G992.3) line>HG612 as a Modem, Bridge, WAN Not Bound to LAN1 or 2 + Also have FTTP (G.984) No One isp Fixed IP >Dual WAN pfSense (Hardware Firewall and routing).> Two WAN's, Ethernet LAN, DMZ LAN, Zyxel GS1100-24 Switch.

Alex Atkin UK

  • Addicted Kitizen
  • *****
  • Posts: 5260
    • Thinkbroadband Quality Monitors
Re: High Efficiency Image File Format (HEIC)
« Reply #10 on: February 12, 2021, 10:09:25 PM »

Sounds like the version of ImageMagick is too old and doesn't have HEIC support, or maybe there's a library missing?
« Last Edit: February 12, 2021, 10:11:54 PM by Alex Atkin UK »
Logged
Broadband: Zen Full Fibre 900 + Three 5G Routers: pfSense (Intel N100) + Huawei CPE Pro 2 H122-373 WiFi: Zyxel NWA210AX
Switches: Netgear MS510TXUP, Netgear MS510TXPP, Netgear GS110EMX My Broadband History & Ping Monitors

petef

  • Reg Member
  • ***
  • Posts: 135
Re: High Efficiency Image File Format (HEIC)
« Reply #11 on: February 15, 2021, 12:04:03 AM »

This is what I see on openSUSE Tumbleweed.

Code: [Select]
$ convert --version
Version: ImageMagick 7.0.10-59 Q16 x86_64 2021-01-24 https://imagemagick.org
Copyright: (C) 1999-2021 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff webp wmf x xml zlib
Logged

Alex Atkin UK

  • Addicted Kitizen
  • *****
  • Posts: 5260
    • Thinkbroadband Quality Monitors
Logged
Broadband: Zen Full Fibre 900 + Three 5G Routers: pfSense (Intel N100) + Huawei CPE Pro 2 H122-373 WiFi: Zyxel NWA210AX
Switches: Netgear MS510TXUP, Netgear MS510TXPP, Netgear GS110EMX My Broadband History & Ping Monitors

tickmike

  • Kitizen
  • ****
  • Posts: 3640
  • Yes Another Penguin !. :)
Re: High Efficiency Image File Format (HEIC)
« Reply #13 on: February 15, 2021, 10:14:07 PM »

I have

$ convert --version
Version: ImageMagick 6.9.9-9 Q16 x86_64 2019-12-15 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype gslib gvc jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png ps rsvg tiff webp wmf x xml zlib
 
I use PCLinuxOS and I put a request to have it updated.
Logged
I have a set of 6 fixed IP's From  Eclipse  isp.BT ADSL2(G992.3) line>HG612 as a Modem, Bridge, WAN Not Bound to LAN1 or 2 + Also have FTTP (G.984) No One isp Fixed IP >Dual WAN pfSense (Hardware Firewall and routing).> Two WAN's, Ethernet LAN, DMZ LAN, Zyxel GS1100-24 Switch.

broadstairs

  • Kitizen
  • ****
  • Posts: 3697
Re: High Efficiency Image File Format (HEIC)
« Reply #14 on: February 16, 2021, 09:36:05 AM »

I have openSUSE Tumbleweed and it has

Code: [Select]
convert --version
Version: ImageMagick 7.0.10-59 Q16 x86_64 2021-01-24 https://imagemagick.org
Copyright: (C) 1999-2021 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff webp wmf x xml zlib

So PCLinux is some way behind. Even Leap 15.2 has V7.

Stuart
« Last Edit: February 16, 2021, 09:39:47 AM by broadstairs »
Logged
ISP:Vodafone Router:Vodafone Wi-Fi hub FTTP
Pages: [1] 2
 

anything