Grunt implementation of Perceptual Image Diff
npm install grunt-image-diff~0.4.2
shell
npm install grunt-image-diff --save-dev
`
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
`js
grunt.loadNpmTasks('grunt-image-diff');
`
The "image_diff" task
$3
In your project's Gruntfile, add a section named image_diff to the data object passed into grunt.initConfig().
`js
grunt.initConfig({
image_diff: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
});
`
$3
#### options.orig
Type: String
Default value: '_orig'
A string value original file pattern.
#### options.diff
Type: String
Default value: '_diff'
A string value difference file pattern.
$3
#### Default Options
`js
grunt.initConfig({
image_diff: {
options: {
orig: '_orig',
diff: '_diff'
},
src: './screenshots/*.png'
},
});
``