/desprite

Split a sprite image by CSS usage

Primary LanguageJavaScript

#desprite#

Split a sprite image by the CSS usage with a simple command-line tool, written in node.

Super important graphic

desprite searches your CSS for qualified1 rules, and crops out the rectangles they reference to seperate2 image files.

1 - rules containing width, height, and background or background-position.
2 - files are named by the rule that referenced their position (usually a class name).

##Usage##

  1. desprite runs on Node.js, so you need that.
  2. You must also install GraphicsMagick - that's how we crop out the images.

Make sure that after your installation, your cmd/terminal responds to "gm" with the GraphicsMagick CLI. 3. That's it. Just git clone (or download zip) and run (for example): ``` $ npm install

$ node desprite.js -i sprite.png -c sprites.css --verbose
```

##Dependencies##

##Acknowledgments##

desprite was authored minimally to solve a problem with our team's project, and probably does not take all wacky cases into consideration. Contributions or feedback about your case are welcome.