There's a tool provided by the libheif package to convert HEIC files (the default file format of choice for photos on iPhones) to file formats people actually use, called heif-convert.

heif-convert IMG_0001.HEIC IMG_0001.png

These suffixes are recognized: jpg, jpeg, png, y4m. If no output filename is specified, 'jpg' is used.

Interestingly, converting to PNG will increase the file size.

Useful one-liners

These have been tested on zsh, but probably work on bash.

Convert all HEIC files in a directory (and use the same file name):

for file in *.HEIC; do heif-convert $file ${file%.HEIC}.png; done

Convert all HEIC files in a directory where a converted file doesn't already exist:

for file in "${$(for x in *.HEIC; do if [ ! -f ${x%.HEIC}.png ]; then echo $x; fi; done)[@]}"; do heif-convert $file ${file%.HEIC}.png; done

(The nested for acts kind of as a list comprehension.)


built by panulat v1.4 - Thu, 19 Dec 2024 14:17:23 GMT