gi

grunt-imgo

Image optimization for Grunt using imgo

Showing:

Popularity

Downloads/wk

3

GitHub Stars

13

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

0

Size (min+gzip)

0.8KB

License

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Image optimization for Grunt using imgo

No Maintenance Intended

Installation

This plugin requires Grunt 0.4.

Install imgo (see How to install imgo on OS X below for instructions).

npm install grunt-imgo --save-dev

Add to your Gruntfile.js:

grunt.loadNpmTasks('grunt-imgo');

Then add section named imgo inside grunt.initConfig(). See next section for details.

Parameters

src string|array

Images list: PNG, GIF or JPEG. String or array. Wildcards are supported.

dest string

Destination path for images copying before optimizing.

icons: {
    src: 'static/dev/img/*.*',
    dest: 'static/build/img/'
}

options string

Any options you want to pass to imgo.

icons: {
    src: 'icons/*.png',
    options: '-m -b'
}

skip boolean

If true task will not be ran. In example, you can skip imgo on Windows (becase of difficult installation):

skip: require('os').platform() === 'win32'

Gruntfile Example

module.exports = function(grunt) {
    grunt.initConfig({
        imgo: {
            icons: {
                src: 'icons/*.png'
            }
        }
    });
    grunt.loadNpmTasks('grunt-imgo');
    grunt.registerTask('default', ['imgo']);
};

How to install imgo on OS X

Install Homebrew.

Run following commands in terminal:

brew install exiftool imagemagick optipng libjpeg gifsicle

formulas='pngout.rb  defluff.rb cryopng.rb imgo.rb'
for package in $formulas
do
  brew install "https://raw.github.com/imgo/imgo-tools/master/Formula/"$package
done

You may need to use sudo for brew, depending on your setup.

Release History

2013-06-18 v0.1.1

  • dest option (by @smolnikov).
  • Fix options: cannot parse several keys.
  • Verbose output of imgo command.

2013-02-18 v0.1.0

  • Grunt 0.4 support.
  • file option renamed to src.

License

The MIT License, see the included License.md file.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial