Installing pngcrush at dreamhost
pngcrush is an excellent optimizer for png images, simple and fast, highly recommended. Basically any time before you post a PNG on the web, you should run it through PNGCrush. It's a command line utility, there's a quick way to integrate pngcrush in windows explorer. (note to self: I actually wrote a wordpress plugin to do crush uploaded images, gotta find and post it)
I'm working (together with Nicole) on an online image optimizer, using the free command line tools I talked about at PHP Quebec, Montreal, O'Reilly's Velocity and the Yahoo! Performance pages. The tool will be free, of course, and hosted on Dreamhost. OK, finally getting to the point, am I?
Here's what I did to install pngcrush on Dreamhost, hope it helps anyone out there who's sweating with the same task.
- ssh to your dreamhost box, you need to give yourself ssh privileges from the dreamhost control panel
mkdir tmp- make a temp directorycd tmp- enter the temp directorywget http://voxel.dl.sourceforge.net/sourceforge/pmt/pngcrush-1.6.10.tar.gz- download latest version of the pngcrush source code, this is the sourceforge mirror, closest to me, yours might be different and the pngcrush version might be newer at the time you install it, you can check heretar zxvf pngcrush-1.6.10.tar.gz- uncompress the code. This creates a new directory, enter it like so:cd pngcrush-1.6.10- now all you need to do is run
make, but didn't work for me, so I edited theMakefilefile first, like sovi Makefile. In the vi editor, press i to enter INSERT mode and once you're done with the changes, press ESC, then type:wq(meaining write, quit). Here I removed the version information from the gcc compiler, so the two lines I edited becameCC = gcc LD = gcc
make- this compiles the pngcrush code and creates a binary calledpngcrushcp pngcrush ~- copy the new binary to your home directorychmod 0755 ~/pngcrush- make the binary executable- All set, try if everything is ok
~/pngcrush, this should display the pngcrush's help information
Crush'em PNGs!
Like so:
~/pngcrush image.png -rem alla -reduce -brute result.png
Need hosting?
[advertisement]Dreamhost is a really good host, use this code MAXDI for $50 off [/advertisement] ![]()

September 9th, 2008 at 2:47 am
I generally create a subdirectory called bin/ under the home directory and put binaries in there. Also, you don’t need to build the binary on the server itself. Just get a box with the same OS, and build on that, and then scp the binary over. That’s the way I used to do it on sourceforge.net.
September 10th, 2008 at 10:58 am
Thanks Philip. Hey, I’m thinking of forming a blues band called Fleetwood PC
Maybe you can do Fleetwood Unix and we can have shows together. And have Fleetwood Mac as an opening band 
October 9th, 2008 at 11:02 am
You mentioned a wordpress plugin to crush images at upload time? Did you get that posted somewhere?
October 9th, 2008 at 12:22 pm
Hey Chris, not yet, but will do