How to use the looks-same.createDiff function in looks-same

To help you get started, we’ve selected a few looks-same examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gemini-testing / gemini / lib / image-processor / compare-adapter.js View on Github external
exports.buildDiff = function(opts, cb) {
    var diffOptions = {
        reference: opts.reference,
        current: opts.current,
        diff: opts.diff,
        highlightColor: opts.diffColor
    };
    if ('tolerance' in opts) {
        diffOptions.tolerance = opts.tolerance;
    }
    looksSame.createDiff(diffOptions, cb);
};
github LinusU / node-appdmg / test / lib / visually-verify-image.js View on Github external
captureWindow('Finder', title, function (err, pngPath) {
    if (err) return cb(err)

    const opts = Object.assign({
      reference: expectedPath,
      current: pngPath,
      highlightColor: '#f0f'
    }, toleranceOpts)

    looksSame.createDiff(opts, function (err, data) {
      if (err) return cb(err)

      temp.writeFile(data, function (err, diffPath) {
        if (err) return cb(err)

        cb(null, { diff: diffPath, actual: pngPath })
      })
    })
  })
}
github gemini-testing / gemini / lib / image / index.js View on Github external
        return Promise.fromCallback((cb) => looksSame.createDiff(diffOptions, cb));
    }
github NiGhTTraX / mugshot / lib / adapters / looks-same.js View on Github external
createDiff: function(img1, img2, callback) {
    var options = objectAssign({}, this._options, {
      reference: img1,
      current: img2
    });

    looksSame.createDiff(options, callback);
  }
});
github NiGhTTraX / mugshot / lib / adaptors / looks-same.js View on Github external
LooksSameAdaptor.prototype.createDiff = function(img1, img2, callback) {
  var options = {
    reference: img1,
    current: img2,
    highlightColor: '#ff00ff',
    strict: true,
    save: false
  };

  looksSame.createDiff(options, callback);
}

looks-same

Pure node.js library for comparing PNG-images, taking into account human color perception.

MIT
Latest version published 4 months ago

Package Health Score

75 / 100
Full package analysis