Skip to content

Instantly share code, notes, and snippets.

@valosekj
Last active January 17, 2021 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save valosekj/c607560c5fdae82dd61601a3937e202e to your computer and use it in GitHub Desktop.
Save valosekj/c607560c5fdae82dd61601a3937e202e to your computer and use it in GitHub Desktop.
Convert photos from HEIF to JPEG #blog

Convert photos from HEIF to JPEG

I use on my iPhone HEIF (High Efficiency Image File Format) format for storing my photos.

This format is widely supported throughout Apple ecosystem but sometimes I need to quickly convert photos from HEIF to JPG to be able to use these photos also elsewhere (Windows, some websites, etc.)

I use for this purpose convert command line tool from ImageMagick

Usage:

Install imagemagick on MacOS using homebrew:

$ brew install imagemagick

Then you can easily convert single photo by covnert command in your Terminal like this:

$ convert my_photo.heic my_photo.jpg

(NB - HEIF format uses .heic extension)

Or all HEIF photos in given directory:

$ for IMAGE in *[hH][eE][iI][cC]; do convert $IMAGE $(echo $IMAGE | sed 's/.[hH][eE][iI][cC]/.jpg/g'); echo "${IMAGE} converted";done

(NB - it is necessary to look for both heic and HEIC extensions because sometimes is extension in lower case and sometimes in upper case)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment