Skip to content

Instantly share code, notes, and snippets.

@jordandraper
Created July 22, 2020 23:08
Show Gist options
  • Save jordandraper/3b6385e592609d905654f35d10df57ad to your computer and use it in GitHub Desktop.
Save jordandraper/3b6385e592609d905654f35d10df57ad to your computer and use it in GitHub Desktop.
# archive of https://blog.wplauncher.com/convert-heic-to-jpg-on-mac/
Step 1: Install Homebrew
Open up your terminal by clicking on your spacebar and the command key at the same time, then type in terminal, and then click on Terminal.app to open it up.
If you’re not used to using your Terminal, it may seem a little intimidating and may make you nervous, but don’t worry this is completely safe. Homebrew is a package manager for macOS, in other words, it installs the stuff you need that Apple didn’t install. You can learn more about Homebrew here.
Once Terminal has opened, run the following command inside of it:
mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
The `mkdir` command above is creating a directory called homebrew, the `curl` command is getting the compressed homebrew repository from GitHub, and the `tar` command is decompressing that file and placing the contents in the newly created homebrew directory.
Step 2: Install Imagemagick
Now that homebrew has been installed, run the following command in terminal to install the imagemagick package as well:
# install imagemagick on your computer using the homebrew package manager
brew install imagemagick
Step 3: Run magick command
And lastly, run the following command in terminal to convert a single HEIC file to a JPG. *Important note* make sure example_image.HEIC (in the command below) references the file name of the HEIC image that you want to convert, and example_image.jpg (in the command below) references the new file name.
# convert an HEIC image to a jpg image
magick convert example_image.HEIC example_image.jpg
Bonus Step: Convert Directory of HEIC files to JPG’s
If you would like to convert a directory of HEIC files to JPGs, navigate to the directory that you want to convert using the cd command. For example, if your files live in a directory called iPhonePics, you would first navigate into that directory by running the following command:
cd iPhonePics
If you want to move into the parent directory of your current directory, run the following command cd ../. Once you’ve navigated to the directory with all of your HEIC files, simply run the following command in your terminal app:
# convert any HEIC image in a directory to jpg format
magick mogrify -monitor -format jpg *.HEIC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment