{"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":{"shasum":"9ecb6cdc15ba049f0638bafb1e8fef4accba8d41","size":280415,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@mirzazeyrek/node-resemble-js/-/node-resemble-js-1.2.1.tgz","integrity":"sha512-+z1c7HpC5ysdSVVyUVz67hctVLl337VlRJP/MBwpvXHkKJdlnSUVrBhlRzxgal7xpm1uDE2JeUhWbQh6wPRC4w=="},"_npmUser":{"name":"anonymous","email":"github@mersinuni.net"},"maintainers":[{"name":"anonymous","email":"github@mersinuni.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-resemble-js_1.2.1_1620169198129_0.4147066744857437"},"_hasShrinkwrap":false,"publish_time":1620169198342,"_cnpm_publish_time":1620169198342,"_cnpmcore_publish_time":"2021-12-16T23:16:56.150Z","contributors":[]}},"dist-tags":{"latest":"1.2.1"},"name":"@mirzazeyrek/node-resemble-js","time":{"created":"2022-01-26T21:12:02.029Z","modified":"2022-01-26T21:12:02.029Z","1.2.1":"2021-05-04T22:59:58.342Z"},"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","users":{}}