What does it do?
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.
Examples
Here are some examples of MODX SmushIt in action and the savings made on various image formats and sizes.
SmushIt Snippet
This snippet expects to be used as an output filter so could be used after you have resized the image using pthumb, phpthumbsup or similar. You could also use this on it's own if you simply wanted to optimise the image.
[[*MyImage:pthumb=`&w=300&h=300`:smushit]]
This will use pthumb to resize the image and then smush it to optimise the file. The thumbnail image is overwritten once and from then on is optimised. This affects first uncached performance so you should review if this is worthwhile. After caching it runs fine and then helps the page load speed by using the new files.
As this is a first release, please use caution when using on a production site.
Download
I currently use this on a few sites but would like your help in testing and reporting any bugs. Your feedback and feature requests are most welcome.
Got something to say?
Join the discussion! You know how these things work; enter your details and comments below and be heard.
Comments 0
There are no comments on this yet.