How to use looks-same - 7 common examples

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 gemini-testing / gemini / lib / calibrator.js View on Github external
function compare_(x) {
        var color = pickRGB(image.getRGBA(x, row));
        return looksSame.colors(color, searchColor);
    }
}
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);
}
github ifiokjr / remirror / e2e / src / helpers / images.ts View on Github external
return new Promise((resolve, reject) => {
    looksSame(image1, image2, { ignoreCaret: true }, (error, { equal }) => {
      if (equal) {
        resolve(equal);
        return;
      }
      const { diff, one, two } = getDiffPaths();

      md(dirname(diff))
        .then(() => {
          return Promise.all([write(one, image1), write(two, image2)]);
        })
        .then(() => {
          createDiff(
            {
              reference: image1,
              current: image2,
              diff: diff,

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

73 / 100
Full package analysis