Reduce PNG sizes from Mac Finder

When I save a screenshot on my systems, it doesn’t try to automatically crush/minify the PNG. Here’s how on a Mac I’ve added a context menu item for images to crush them. This can help save storage space or make web pages load faster.

  1. Ensure you have pngquant installed. Other tools may work for you, but this post is pngquant-specific. I got it via Homebrew.
  2. Open Automator.
  3. Choose Service.
  4. In the Service Receives drop-down, select image files.
  5. In the left pane, select Utilities under Library.
  6. From the middle pane, drag Run Shell Script to the right pane.
  7. On the top of the box that was just created, use /bin/bash as the shell and pass input as arguments.
  8. Paste in the following code for the shell script:
  9. Choose a name to save the script as which is how you’d like to see in when right-clicking to get the context menu. I named mine png_crush.

Now when you right-click a PNG in Finder, go to Services, and click on the entry for png_crush. Works for multiple-selected files as well.

Reduce PNG sizes from Mac Finder is original content from devolve.