{"id":16278615,"url":"https://github.com/sigoden/node-imagediff","last_synced_at":"2026-05-16T11:02:31.242Z","repository":{"id":103522063,"uuid":"146849582","full_name":"sigoden/node-imagediff","owner":"sigoden","description":"Diff image to check whether objects have changed.","archived":false,"fork":false,"pushed_at":"2018-09-02T14:38:29.000Z","size":189,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-14T13:50:35.657Z","etag":null,"topics":["image-diff","opencv"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sigoden.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-31T06:13:48.000Z","updated_at":"2020-03-22T18:57:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"3dfec67e-2584-4465-80dd-1772a940e8f0","html_url":"https://github.com/sigoden/node-imagediff","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"861f1138d67b2ccb2bcc3f7e1161ae53b8babf39"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigoden%2Fnode-imagediff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigoden%2Fnode-imagediff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigoden%2Fnode-imagediff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigoden%2Fnode-imagediff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sigoden","download_url":"https://codeload.github.com/sigoden/node-imagediff/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247893401,"owners_count":21013887,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["image-diff","opencv"],"created_at":"2024-10-10T18:59:11.867Z","updated_at":"2025-10-24T03:11:51.807Z","avatar_url":"https://github.com/sigoden.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# diff image utils\n\nDiff image to check whether objects have changed.\n\n\u003e Depends on [SSIM](https://en.wikipedia.org/wiki/Structural_similarity) and opencv.\n\n## Install\n\n**install opencv 3.x**\n\nFor linux\n\n```\ngit clone https://github.com/opencv/opencv\nmkdir opencv/build\ncd opencv/build\ncmake ..\nsudo make install\n```\n\nFor mac\n\n```\nbrew tap homebrew/science\nbrew install opencv@3\nbrew link --force opencv@3\n```\n\n**install npm package**\n\n```\nnpm install @sigodenjs/imagediff\n```\n\n## Usage\n\n```js\nconst { diffFactor, diffImage } = require('..');\n\nconst img1 = fs.readFileSync(\"img1.jpg\");\nconst img2 = fs.readFileSync(\"img2.jpg\");\nconst factor = diffFactor(img1, img2);\nconst img = diffImage(img1, img2);\nfs.writeFileSync(\"/tmp/imgdiff.jpg\", img);\n```\n\n| img1                        | img2                        | diff                       | score |\n| --------------------------- | --------------------------- | -------------------------- | ----- |\n| ![pic1](https://raw.githubusercontent.com/sigoden/node-imagediff/master/example/pic1.jpg)   | ![pic2](https://raw.githubusercontent.com/sigoden/node-imagediff/master/example/pic2.jpg)   | ![pic1](https://raw.githubusercontent.com/sigoden/node-imagediff/master/doc/picdiff.jpg)   | 0.047 |\n| ![view1](https://raw.githubusercontent.com/sigoden/node-imagediff/master/example/view1.jpg) | ![view2](https://raw.githubusercontent.com/sigoden/node-imagediff/master/example/view2.jpg) | ![view1](https://raw.githubusercontent.com/sigoden/node-imagediff/master/doc/viewdiff.jpg) | 0     |\n\n## License\n\nCopyright (c) 2018 sigoden\n\nLicensed under the MIT license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigoden%2Fnode-imagediff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsigoden%2Fnode-imagediff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigoden%2Fnode-imagediff/lists"}