twolfson / grunt-spritesmith

Grunt task for converting a set of images into a spritesheet and corresponding CSS variables
MIT License
1.14k stars 92 forks source link

how to set the output img format? #155

Closed ghostlvs closed 8 years ago

ghostlvs commented 8 years ago

can you give me a demo output gif img,please.

twolfson commented 8 years ago

By providing an image with the .gif extension, a GIF should automatically be exported:

{
    src: 'path/to/your/sprites/*.gif',
    dest: 'destination/of/spritesheet.gif',
    destCss: 'destination/of/sprites.css'
}

If you want to manually override the assumed extension, then imgOpts.format can be used to specify gif:

{
    src: 'path/to/your/sprites/*.data',
    dest: 'destination/of/spritesheet.data',
    destCss: 'destination/of/sprites.css',
    imgOpts: {
        format: 'gif'
    }
}