{"_id":"@mirzazeyrek/node-resemble-js","_rev":"1-8969e19071426f806384f30664b075e8","name":"@mirzazeyrek/node-resemble-js","dist-tags":{"latest":"1.2.1"},"versions":{"1.2.1":{"name":"@mirzazeyrek/node-resemble-js","version":"1.2.1","description":"Image analysis and comparison for nodejs","main":"resemble.js","scripts":{"test":"gulp test"},"precommit":["build"],"repository":{"type":"git","url":"git+https://github.com/mirzazeyrek/node-resemble.js.git"},"keywords":["comparison","image","diff","compare"],"author":{"name":"Mirza Zeyrek","email":"mirzazeyrek+resemblejs@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/mirzazeyrek/node-resemble.js/issues"},"homepage":"https://github.com/mirzazeyrek/node-resemble.js","dependencies":{"jpeg-js":"^0.4.2","pngjs":"^6.0.0"},"devDependencies":{"gulp":"^4.0.2","gulp-jasmine":"^4.0.0","gulp-util":"^3.0.8"},"directories":{"example":"example"},"gitHead":"87d24ca77e58945f92f45909c907c15c8ef97f50","_id":"@mirzazeyrek/node-resemble-js@1.2.1","_nodeVersion":"15.13.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-+z1c7HpC5ysdSVVyUVz67hctVLl337VlRJP/MBwpvXHkKJdlnSUVrBhlRzxgal7xpm1uDE2JeUhWbQh6wPRC4w==","shasum":"9ecb6cdc15ba049f0638bafb1e8fef4accba8d41","tarball":"https://registry.npmjs.org/@mirzazeyrek/node-resemble-js/-/node-resemble-js-1.2.1.tgz","fileCount":18,"unpackedSize":466020,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkdHuCRA9TVsSAnZWagAA90wP/RpaEqL4ojbd9tFznscm\nLWdVgk2L4YDf6iaRe0rnnZk0npkwPMxu+MiUeB/qjET/3Hb2wQfs16DdRApa\neg7i45j30f8Q96XE+7IuYgpoSc93GTgh7KO97Y1IsLrmDv2viD2j+t4tZRh6\nLggdeMfbNe4b5+S1N6ts3sNgJV8JjAVEuhxgdoISP0Eyp9y6TfXU/Vrmp0gB\ni5pG1rDjzkGTsG0uKINZM7npCff45YoNJTttXhUGXd3sL8bQpfo3e6gWqxKQ\n/LXY6rbPPWl6MP2F373B2FrHRRsJrRlp/1Res04Kl4Hk9CZZUw6s/ORrJviE\nrh/WvINsl8fBn9Nr64s0PMWzdvhI9hJFsusxwNIR+6yywzRUOm1nAn4CSJKT\n5bCyMbVsi2E03q6Q/ltCXxtoWP/iBLTzh5aEUQKC9k10qdQjeWx5TldNHmEi\nuo3bD6AV/qIlYAPupVMyV8dYEPUMjGHahD1kIqLlujILq4tq7Kw+whu8l+0q\ni2JUb3b4a5TMOPFdBwkpa6ZePEcUx8UepcCFepyHDa54jmvwIehCYt+TP9xf\nD4YqjpCa7AgBA4djgVtBiMW8/WceNWN4MPxtXcssclB9cnsBlFDkRhSNMo+D\noWPF00H+ZS22UGaTfMJxIBXZorvqkEHIXnKS8ghWzqFx+JLZ7lJMyfPn79LB\n+m8J\r\n=3zRN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCE+sqao70lNKxaX6CA6T6AED8vG32kayaLD2nGjIbA3gIgYH7b4fchk64U1341aF+FETMEEMf3yOXSe1kJqJDpltI="}]},"_npmUser":{"name":"mirzazeyrek","email":"github@mersinuni.net"},"maintainers":[{"name":"mirzazeyrek","email":"github@mersinuni.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-resemble-js_1.2.1_1620169198129_0.4147066744857437"},"_hasShrinkwrap":false}},"time":{"created":"2021-05-04T22:59:58.085Z","1.2.1":"2021-05-04T22:59:58.342Z","modified":"2022-04-06T05:48:21.356Z"},"maintainers":[{"name":"mirzazeyrek","email":"github@mersinuni.net"}],"description":"Image analysis and comparison for nodejs","homepage":"https://github.com/mirzazeyrek/node-resemble.js","keywords":["comparison","image","diff","compare"],"repository":{"type":"git","url":"git+https://github.com/mirzazeyrek/node-resemble.js.git"},"author":{"name":"Mirza Zeyrek","email":"mirzazeyrek+resemblejs@gmail.com"},"bugs":{"url":"https://github.com/mirzazeyrek/node-resemble.js/issues"},"license":"MIT","readme":"node-resemble.js\n\nAnalyse and compare images with Javascript. This project does not need canvas or any other binary dependencies.\nIt is a modification of [Resemble.js](https://github.com/Huddle/Resemble.js)\n\n\n### Get it\n\n`npm install node-resemble-js`\n\n### Example\n\nRetrieve basic analysis on image.\n\n```javascript\nvar api = resemble(fileData).onComplete(function(data){\n\tconsole.log(data);\n\t/*\n\t{\n\t  red: 255,\n\t  green: 255,\n\t  blue: 255,\n\t  brightness: 255\n\t}\n\t*/\n});\n```\n\nUse resemble to compare two images.\n\n```javascript\nvar diff = resemble(file).compareTo(file2).ignoreColors().onComplete(function(data){\n\tconsole.log(data);\n\t/*\n\t{\n\t  misMatchPercentage : 100, // %\n\t  isSameDimensions: true, // or false\n\t  dimensionDifference: { width: 0, height: -1 }, // defined if dimensions are not the same\n\t  getImageDataUrl: function(){}\n\t}\n\t*/\n});\n```\n\nYou can also change the comparison method after the first analysis.\n\n```javascript\n// diff.ignoreNothing();\n// diff.ignoreColors();\ndiff.ignoreAntialiasing();\n```\n\nAnd change the output display style.\n\n```javascript\nresemble.outputSettings({\n  errorColor: {\n    red: 255,\n    green: 0,\n    blue: 255\n  },\n  errorType: 'movement',\n  transparency: 0.3\n});\n// resembleControl.repaint();\n```\n\n--------------------------------------\n## Example usuage (in cucumber step definition)\n\n\n     this.Then(/^Screenshot should match image \"(.*)\"$/, function (image, callback) {\n        browser.takeScreenshot().then(function(pngString) {\n          var screenshot = new Buffer(pngString, 'base64');\n     \n          resemble(image)\n            .compareTo(screenshot)\n            .onComplete(function(data){\n     \n              if (Number(data.misMatchPercentage) <= 0.01) {\n                callback();\n              } else {\n                data.getDiffImage().pack().pipe(fs.createWriteStream(image + 'diff.png'));\n                callback.fail(new Error(\"Screenshot '\" + image+  \"' differ \" + data.misMatchPercentage + \"%\"));\n              }\n            });\n        });\n      })\n\n--------------------------------------\n\nCredits:\n * Created by [James Cryer](https://github.com/jamescryer) and the Huddle development team.\n * [Lukas Svoboda](https://github.com/lksv) - modification for node.js\n * [Mirza Zeyrek](https://github.com/mirzazeyrek) - jpeg support\n * [LarryG](https://github.com/larryg01) - dependency updates","readmeFilename":"README.md"}