Monday, February 25th, 2008
CSS Sprite Generator: Open Sourced and Adapted
Ryan Breen has been tinkering with the CSS Sprite Generator that Ed Eliot and Stuart Colville recently open sourced.
How did he tweak it?
One of the first articles I wrote about CSS sprites covered the built-in support in GWT, and I focused on their clever trick of including an MD5 checksum of the sprite map contents into the filename. This allows you to set effectively infinite cache headers since the name will change if the underlying image is modified.
Since the CSS sprite generator is now open source, I decided to add the checksum approach as an optional feature (on by default). You can try it here, or grab the tar or patch.












let me have a try
Nice tool, the md5 checksums option is really useful!
If you’re looking for a CSS sprite generator running as a desktop app (also Open Source / BSD), you may want to check this:
http://smartsprites.osinski.name/
Due to a different approach to the problem, the tool supports some additional CSS sprites scenarios (like spriting repeated backgrounds). It also automatically rewrites your CSS files, which might be sometimes more convenient. No online version yet though…
If you’re interested in a post-build/deployment tool for web applications you should checkout the Sonic project on codeplex (http://www.codeplex.com/sonic/)
It’s just starting up, but it’s ultimate aim is to control CSS, JS, PNG compression (possibly spriting as well), as well as renaming files to control caching and updating all file references to the new filenames.