How to Optimize a Bunch of Screenshots and Merge Them Into a PDF File

Screenshots · PngQuant · ImageMagick · PDF


After making a ton of screenshots I needed to make a single PDF file. Here’s how to do it on a MacOS.

  • Firstly, move all of your PNG images into one directory
  • Then optimize these images using pngquant:
for file in *.png; do
  pngquant --force --ext .png "$file"
done
  • Convert optimized images into a PDF file using imagemagick:
convert *.png merged.pdf

That’s it!