Convert a PDF File to PNG or JPG With Imagemagick on Mac

Published: Feb 10, 2020
Updated: May 3, 2021

I needed to convert some large PDF files into images for my wife. All of the free online converters had a file size limit of around 25 MB… but the files I was working with were a few hundred MB. Once again, Imagemagick comes to the rescue. Here’s how to do it:

Setup #

  1. Install Homebrew

  2. Install Imagemagick

     brew install imagemagick
    
  3. Check that the version is 7.0.9-21 or higher

     magick --version
    
  4. Install Ghostscript, which allows Imagemagick to convert from PDFs

     brew install ghostscript
    
  5. Check that the version is 9.50 or higher

     gs --version
    

Convert #

# PDF to PNG
magick file.pdf file.png

# PDF to JPG
magick file.pdf file.jpg