pw-grunt-smushit

A Grunt task to remove unecessary bytes of PNG and JPG using Yahoo Smushit

npm install pw-grunt-smushit
2 downloads in the last week
5 downloads in the last month

grunt-smushit

Grunt task to remove unecessary bytes of PNG and JPG, it uses node-smushit

Smush.it uses optimization techniques specific to image format to remove unnecessary bytes from image files. It is a "lossless" tool, which means it optimizes the images without changing their look or visual quality.

Read more about Smush.it

Getting Started

Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-smushit

Then add this line to your project's grunt.js gruntfile:

grunt.loadNpmTasks('grunt-smushit');

Documentation

There are many ways to use grunt-smushit:

smushit:{

    // with output folder (should not be inside source path)
    destination:{
        src:'tests/img',
        dest:'tests/opt_img'
    },

    //with source images and output folder
    destination1:{
        src:['tests/img/logo.png','tests/img/whatever.png'],
        dest:'tests/img/min'
    },

    // recursive extension filter with output folder
    destination2: {
        src: ['tests/img/**/*.png'],
        dest:'tests/img/min'
    },

    //replace images
    specific: {
        src:['tests/img/logo.png','tests/img/tellme.jpg']
    },

    //replace by extension
    specificExtension: {
        src:['tests/img/**/*.png']
    },

    //replace recursive
    path: {
        src:'tests/img'
    },

    //replace single image
    single: {
        src:'tests/img/logo.png'
    }
}

License

MIT License (c) Helder Santana

based on: grunt-recess

npm loves you