I've created this small sprite to create css sprites. It glues images from directory directory into single file and generates corresponding css.
This article is pretty old. Now it's better to use something integrated to your build process, like grunt or webassets.