This snippet optimises and compresses PNG and JPEG images for better performance using the resmush.it optimisation API. This will help with Google Page Speed and can reduce image sizes by up to 70%. This will overwrite any existing images so is intended to be used as an output filter after pthumb or similar.
This works best on alpha transparent PNGs but it normally creates some saving on JPEG images too.