img-diff-rect

1.0.2 • Public • Published

img-diff-rect

NPM version node version Test coverage License

Mark differences of two images in rectangles based on x-img-diff-js.

Demo

output 1

output 1

Usage

You need Node.js >= v8.0.0

const imgDiffRect = require('img-diff-rect');
 
imgDiffRect({
  originImg: './origin.png',
  expectedImg: './expected.png',
  outputDir: './output',
}).then((result) => {
  console.log(result);
  // {
  //   isDifferent: true,
  //   originOutputImg: './output/origin.png',
  //   expectedOutputImg: './output/expected.png',
  // }
});

Type

DifferOption

interface DifferOption {
  originImg: string;
  expectedImg: string;
  outputDir?: string;
}

DifferResult

interface DifferResult {
  isDifferent: boolean;
  originOutputImg?: string;
  expectedOutputImg?: string;
}

Package Sidebar

Install

npm i img-diff-rect

Weekly Downloads

5

Version

1.0.2

License

MIT

Unpacked Size

1.17 MB

Total Files

27

Last publish

Collaborators

  • elvinn