Compiling Pngcrush on Mac OS X Snow Leopard

Pngcrush is a command line tool that processes png files through several algorithms (read “magics”), optimizing the png without quality loss. Here is how you can install it from source on snow leopard.

  1. Download Pngcrush
  2. Extract the Source Code
  3. Compile Pngcrush
  4. Using Pngcrush

Download Pngcrush

Download Pngcrush (Direct Download Link)

I save source files into ~/src/

Extract the Source Code

Open terminal and run these commands to extract the source code.

	cd ~/src
	tar -xvzf pngcrush-1.7.2.tar.gz
	cd pngcrush-1.7.2

Compile Pngcrush

While in the pngcrush-1.7.2 folder, run these commands to compile it.

	make
	sudo mv pngcrush /usr/local/bin/

The make command compiles the code. I move the executable to /usr/local/bin/ in as suggested by Dan Benjamin. It does not matter where you move the compiled executable, but I recommend that you put it in a place within your environment’s path.

Using Pngcrush

To crush a png file, run this command on the shell.

	pngcrush -reduce -brute source.png destination.png

3 thoughts on “Compiling Pngcrush on Mac OS X Snow Leopard

  1. Only just getting into Terminal…

    What do you mean by “run this command on the shell.” in the last step?

  2. Hey.

    Thanks for the post, it was really hard to find data on this.
    Would love to see post on batch use with pngcrush.

    Thanks again
    Shani

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>