Written by James McDonald

September 29, 2011

I’m noodling away at my websites performance using the Google Page Speed plugin.

It recommends losslessly compressing your images using a number of utilities.

I mostly upload png format images so I ran the following on my WordPress content folder to compress the images.

# install both the jpegtran and optipng compression tools
apt-get install libjpeg-progs
apt-get install optipng 

# change to your wordpress content directory
cd /path/to/your/wordpress/wp-content

# run a command to find and compress all your png's
# this will take a while if you have been blogging a lot of images
find  . -type f  -name *.png | xargs -IFILE optipng FILE

# clear your browser cache and rerun Page Speed 
# to see if you have made an improvement. 
# (I went from 90 to 91 on my page speed rank)


Submit a Comment

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…