0% found this document useful (0 votes)
187 views1 page

Linux HEIF to JPG/PNG Conversion Guide

The document discusses how to convert HEIF image files to JPG or PNG format on Linux. It provides instructions to install the necessary libheif package and use the heif-convert command, specifying the input and output files and optionally the quality level. It also gives examples of using for loops or find to bulk convert multiple files.

Uploaded by

John Doe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
187 views1 page

Linux HEIF to JPG/PNG Conversion Guide

The document discusses how to convert HEIF image files to JPG or PNG format on Linux. It provides instructions to install the necessary libheif package and use the heif-convert command, specifying the input and output files and optionally the quality level. It also gives examples of using for loops or find to bulk convert multiple files.

Uploaded by

John Doe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Convert HEIF Images to JPG or PNG on Linux (With Commands)

HEIF photos (those with the .HEIC file extension) can store image data more
efficiently than JPG or PNG, which yields a smaller file size. But the glaring
drawback is that HEIF doesn’t enjoy widespread support. If you have some HEIF
photos that you need to convert to a different format, this can be done from the Linux
command line.

In this tutorial, you’ll see how to convert HEIF images to JPG or PNG with Linux
commands.

Install libheif on Linux


The heif-convert command is used to convert HEIF images to other formats. Use the
appropriate command below to install the libheif package, containing the heif-convert
utility, with your system’s package manager.

$ sudo apt install libheif-examples

Convert HEIF images to JPG or PNG

1. Use the following syntax with the heif-convert command to convert a photo.
Simply supply the name of the input file (the HEIC photo) followed by the name of
the output file (the new JPG or PNG photo).

$ heif-convert image.HEIC new-image.jpg


or…

$ heif-convert image.HEIC new-image.png

2. The -q option will control the quality level of the output image. To keep your
converted photos looking sharp, you should use the -q 100 setting to convert at
maximum quality.

$ heif-convert -q 100 image.HEIC new-image.jpg

3. If you have a lot of HEIF photos to convert, you can use a Bash for loop to bulk
convert hundreds or thousands of HEIC photos at once.

$ for f in *.HEIC; do heif-convert -q 100 $f $f.jpg; done

4. If you have HEIF files scattered throughout subdirectories, you can use the find
command to traverse subdirectories and convert every .HEIC (or .heic) file that it
finds.

$ find . -iname "*.heic" -exec heif-convert -q 100 {} {}.jpg \;

You might also like