Sprite Mate
MIT License
Sprite Mate
$ npm install spritemate -g
$ spritemate example/icon1over.png example/icon2over.png -o example/output.png
Result:
+ =
And styles:
following is styles:
example/icon1over.png
{
width: 16px;
height: 26px;
background-position: 0 0;
}
example/icon2over.png
{
width: 16px;
height: 26px;
background-position: 0 -26px;
}
var mate = require('spritemate');
var images = ['/path/to/image1.png', '/path/to/image2.png'];
var output = '/path/to/output.png';
mate(images, output, function (err, finalName, styles) {
console.log('generate sprite at: ' + path.relative(path.resolve('.'), finalName).green);
console.log('');
console.log('following is styles:');
for (var file in styles) {
console.log('');
console.log(path.relative(path.resolve('.'), file));
console.log('');
console.log(format(styles[file]).yellow);
}
});
The MIT License