{"id":33950,"date":"2021-06-13T16:45:57","date_gmt":"2021-06-13T16:45:57","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=33950"},"modified":"2023-05-31T11:54:11","modified_gmt":"2023-05-31T11:54:11","slug":"open-heic-convert-jpg-png-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2021\/06\/open-heic-convert-jpg-png-ubuntu-20-04\/","title":{"rendered":"How to Open iOS HEIC Photos or Convert to JPG\/PNG in Ubuntu 20.04 | 22.04"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/gthumb-logo.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-33952\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/gthumb-logo.png\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/gthumb-logo.png 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/gthumb-logo-150x150.png 150w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>Got .HEIC photo images import from your iPhone? You may found that Ubuntu does not open the file format out-of-the-box.<\/p>\n<p>It&#8217;s however easy to either enable this file format support or convert it to JPG or PNG image.<\/p>\n<h3>Enable HEIF\/HEIC Support for the Default Image Viewer<\/h3>\n<p>In <b>Ubuntu 20.04<\/b> and <b>Ubuntu 22.04<\/b>, you can easily enable the HEIF \/ HEIC file format support via libheif libraries.<\/p>\n<p>1.) Simply search for and open terminal from system app launcher (or press Ctrl+Alt+T on keyboard).<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/04\/terminal-focal.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9967\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/04\/terminal-focal.jpg\" alt=\"\" width=\"490\" height=\"256\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/04\/terminal-focal.jpg 490w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/04\/terminal-focal-450x235.jpg 450w\" sizes=\"auto, (max-width: 490px) 100vw, 490px\" \/><\/a><\/p>\n<p>2.) When terminal opens, run command to install the library:<\/p>\n<pre style=\"border: none;\">sudo apt install heif-gdk-pixbuf<\/pre>\n<p><i>Type user password (no asterisk feedback) when it asks and hit Enter<\/i><\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/apt-heif-decoder.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-33954\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/apt-heif-decoder-600x213.jpg\" alt=\"\" width=\"600\" height=\"213\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/apt-heif-decoder-600x213.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/apt-heif-decoder-300x106.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/apt-heif-decoder.jpg 711w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Now, double-click to open the <i>.heic<\/i> (or right-click -&gt; Open with Other Application -&gt; select Image Viewer) photo and enjoy!<\/p>\n<p>For <b>Ubuntu 18.04<\/b> \/ <b>Ubuntu 16.04<\/b> users, the library is not available in system repositories. You have to add the <a href=\"https:\/\/launchpad.net\/~strukturag\/+archive\/ubuntu\/libheif\" target=\"_blank\" rel=\"noopener\">third-party PPA<\/a> by running command:<\/p>\n<pre style=\"border: none;\">sudo add-apt-repository ppa:strukturag\/libheif<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/libheif-ppa.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-33955\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/libheif-ppa-600x223.jpg\" alt=\"\" width=\"600\" height=\"223\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/libheif-ppa-600x223.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/libheif-ppa-300x111.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/libheif-ppa.jpg 760w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Then refresh package cache via:<\/p>\n<pre style=\"border: none;\">sudo apt update<\/pre>\n<p>And finally run the command in step 2.) to get it installed.<\/p>\n<h3>Convert HEIF\/HEIC to JPEG or PNG<\/h3>\n<p>It&#8217;s also quite easy to convert the photo to another format in Ubuntu Linux.<\/p>\n<p>Simply open the photo via either <b>GIMP<\/b> or <b>Krita<\/b> image editor (<i>both available in Ubuntu Software<\/i>), then select <b>Export<\/b> to JPG \/ PNG.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/gimp-exportas.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-33956\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/gimp-exportas-600x359.jpg\" alt=\"\" width=\"600\" height=\"359\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/gimp-exportas-600x359.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/gimp-exportas-300x179.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/gimp-exportas-768x459.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/gimp-exportas.jpg 1039w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p><strong>Too many HEIC photos to convert? Using <code>heif-convert<\/code> command will be more effective.<\/strong><\/p>\n<p>1.) Firstly open terminal and run command to install <code>heif-convert<\/code> tool:<\/p>\n<pre style=\"border: none;\">sudo apt install libheif-examples<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/apt-heif-convert.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-33957\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/apt-heif-convert-600x187.jpg\" alt=\"\" width=\"600\" height=\"187\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/apt-heif-convert-600x187.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/apt-heif-convert-300x93.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/apt-heif-convert.jpg 752w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>2.) Next you can convert a HEIC file to JPEG via command:<\/p>\n<pre style=\"border: none;\">heif-convert -q 85 input.HEIC output.JPG<\/pre>\n<p>Here <code>-q 85<\/code> specifies the output quality level. You can skip it to use default value 92.<\/p>\n<p><b>To batch convert HEIC photos to JPEG<\/b>, firstly navigate to the photo folder in file manager and select &#8216;Open in Terminal&#8217; from context menu:<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/open-photo-terminal.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-33958\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/open-photo-terminal-600x341.jpg\" alt=\"\" width=\"600\" height=\"341\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/open-photo-terminal-600x341.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/open-photo-terminal-300x171.jpg 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/open-photo-terminal-768x437.jpg 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/open-photo-terminal.jpg 823w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Finally run command:<\/p>\n<pre>for file in *.HEIC; do heif-convert $file ${file%.HEIC}.jpg; done<\/pre>\n<p><b>NOTE:<\/b> Linux commands are case sensitive! If your HEIC photos have file extension in lower-case, replace <b>HEIC<\/b> with <b>heic<\/b> in the last command.<\/p>\n<p>For instance, convert all <code>.HEIC<\/code> photos to <code>jpg<\/code> with quality 100%, run command:<\/p>\n<pre style=\"border: none;\">for file in *.HEIC; do heif-convert -q 100 $file ${file%.HEIC}.jpg; done<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/heif-convert-jammy.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-43071\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/heif-convert-jammy-600x262.webp\" alt=\"\" width=\"600\" height=\"262\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/heif-convert-jammy-600x262.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/heif-convert-jammy-300x131.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/heif-convert-jammy-768x335.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/06\/heif-convert-jammy.webp 816w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h3>Updates for Ubuntu 22.04 LTS:<\/h3>\n<p>The powerful Imagemagick package in Ubuntu 22.04 repository has support the HEIC\/HEIF image format!<\/p>\n<p>First, press <b>Ctrl+Alt+T<\/b> on keyboard to open terminal and run command to install the tool:<\/p>\n<pre>sudo apt install imagemagick<\/pre>\n<p>Then, open the folder that contains the photo images, right-click on select &#8220;Open in Terminal&#8221; and finally use command to convert:<\/p>\n<pre>convert input.HEIC -quality 95 output.JPG<\/pre>\n<p>Change the number in <code>-quality 95<\/code>, or skip it to use default 90. To convert a batch of files (from .HEIC to .jpg), use command:<\/p>\n<pre>for file in *.HEIC; do convert $file ${file%.HEIC}.jpg; done<\/pre>\n<p>That&#8217;s all. Enjoy!<\/p>","protected":false},"excerpt":{"rendered":"<p>Got .HEIC photo images import from your iPhone? You may found that Ubuntu does not open the file format out-of-the-box. It&#8217;s however easy to either enable this file format support or convert it to JPG or PNG image. Enable HEIF\/HEIC Support for the Default Image Viewer In Ubuntu 20.04 and Ubuntu 22.04, you can easily [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":33951,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[2038],"class_list":["post-33950","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-heif"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/33950","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=33950"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/33950\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/33951"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=33950"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=33950"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=33950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}