grunt-phantom-rasterize
v2.1.0
Published
Convert an SVG to one or more named PNG files
Downloads
5
Maintainers
Readme
grunt-phantom-rasterize 
Installation
If you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide, as it explains how to create a [gruntfile][Getting Started] as well as install and use grunt plugins. Once you're familiar with that process, install this plugin with this command:
npm install --save-dev grunt-phantom-rasterizeOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-phantom-rasterize');Documentation
See the Gruntfile in this repo for a full example.
Example Generating Icons for an iOS Application
grunt.initConfig({
rasterize : {
ios : {
options: {
sizes : [
{ width : 29, name : 'Icon-Small.png' },
{ width : 40, name : 'Icon-Small-40.png' },
{ width : 58, name : '[email protected]' },
{ width : 76, name : 'Icon-76.png' },
{ width : 80, name : '[email protected]' },
{ width : 87, name : '[email protected]' },
{ width : 120, name : '[email protected]' },
{ width : 120, name : '[email protected]' },
{ width : 152, name : '[email protected]' },
{ width : 180, name : '[email protected]' },
{ width : 512, name : '[email protected]' },
{ width : 1024, name : '[email protected]' }
]
},
files: [
{
expand: true,
cwd: 'graphics/icons',
src: ['ios.svg'],
dest : 'ios-prod/'
},
{
expand: true,
cwd: 'graphics/icons',
src : ['ios-dev.svg'],
dest : 'ios-dev/'
}
]
}
}
});
grunt.loadNpmTasks("grunt-phantom-rasterize");Tip: the grunt-newer module might come in handy if you have a large number of files.
License
unlicence
