UNPKG

node-sprite-generator

Version:

Generates image sprites and their spritesheets (css, stylus, sass, scss or less) from sets of images. Supports retina sprites. Provides express middleware and grunt task.

13 lines (10 loc) 333 B
'use strict'; var _ = require('underscore'); module.exports = function scaleImages(images, options) { return _(images).map(function (image) { return _.extend({}, image, { width: Math.round(image.width * options.scaling), height: Math.round(image.height * options.scaling) }); }); };