Compress png images on osx using pngcrush

Xcode comes bundled with pngcrush, you can find it here:


Add it to your path in your .bash_profile or .zshrc to avoid typing in the long nested directories.

export PATH="$PATH:/Applications/"

If you don’t have Xcode then install using homebrew

brew install pngcrush


pngcrush [options] infile.png outfile.png


Options are optional, some interesting ones to note are:

  • -iphone (optimize for iPhone OS)
  • -revert-iphone-optimizations (convert iPhone OS optimized PNG to a PNG readable on other platforms)