Code Monkey home page Code Monkey logo

grunt-smushit's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.