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 theMakefile
file 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 calledpngcrush
cp pngcrush /usr/bin/
- copy the new binary to where binaries usually live- 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 MAXDISCO
for $50 off [/advertisement] 😉
Comments? Find me on BlueSky, Mastodon, LinkedIn, Threads, Twitter