{"id":16125662,"url":"https://github.com/dy/image-equal","last_synced_at":"2026-03-11T04:31:47.238Z","repository":{"id":57271982,"uuid":"150104375","full_name":"dy/image-equal","owner":"dy","description":"Test if two images are equal","archived":false,"fork":false,"pushed_at":"2018-12-11T22:28:50.000Z","size":52,"stargazers_count":11,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-19T23:59:28.273Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dy.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-24T13:10:09.000Z","updated_at":"2022-11-29T10:14:54.000Z","dependencies_parsed_at":"2022-08-25T06:43:23.342Z","dependency_job_id":null,"html_url":"https://github.com/dy/image-equal","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dy/image-equal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fimage-equal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fimage-equal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fimage-equal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fimage-equal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dy","download_url":"https://codeload.github.com/dy/image-equal/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fimage-equal/sbom","scorecard":{"id":361908,"data":{"date":"2025-08-11","repo":{"name":"github.com/dy/image-equal","commit":"ce43903c6c4f07fb106a943377dc5c04f87fa287"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-18T11:03:37.033Z","repository_id":57271982,"created_at":"2025-08-18T11:03:37.033Z","updated_at":"2025-08-18T11:03:37.033Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30370797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"online","status_checked_at":"2026-03-11T02:00:07.027Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-09T21:30:29.143Z","updated_at":"2026-03-11T04:31:47.218Z","avatar_url":"https://github.com/dy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# image-equal [![unstable](https://img.shields.io/badge/stability-unstable-green.svg)](http://github.com/badges/stability-badges) [![Build Status](https://img.shields.io/travis/dy/image-equal.svg)](https://travis-ci.org/dy/image-equal)\n\nTest if two images are equal. Useful for organising baseline tests for visual components.\n\n## Usage\n\n[![npm install image-equal](https://nodei.co/npm/image-equal.png?mini=true)](https://npmjs.org/package/image-equal/)\n\n```js\nlet t = require('tape')\nlet equal = require('image-equal')\nlet pixels = require('image-pixels')\n\nt('image test', async t =\u003e {\n\tt.ok(equal(await pixels('./a.png'), canvasA))\n\tt.ok(equal(await pixels('./b.png'), canvasB, {threshold: .2}))\n\n\t// display diff to console in case of mismatch\n\tt.ok(equal(await pixels('./c.png'), canvasC, true))\n\n\t// compare two pixel arrays\n\tt.ok(equal([0,0,0,255,255,255,255,255], [0,0,0,255,255,255,255,255]))\n\n\tt.end()\n})\n```\n\n### `equal(imageA, imageB, diff?, threshold=0.1|options?)`\n\nTakes two images and returns `true` if they're similar and `false` otherwise, optionally sending diff stats to `diff` output. `options` can adjust comparison logic.\n\n#### `imageA`, `imageB`\n\nShoud be actual image data container, one of:\n\n* _Canvas_, _Context2D_, _WebGLContext_\n* _ImageData_ or _Object_ `{data: Uint8Array, width, height}`\n* DataURL or base64 string\n* _Image_, _Video_, _ImageBitmap_ with resolved data\n* _Array_, _Array_ of _Arrays_, _Uint8Array_, _FloatArray_ with raw pixels\n* _ArrayBuffer_, _Buffer_\n* _Ndarray_\n\nTo use async image source, like URL, path, _ImageBitmap_, _Promise_, incomplete _Image_/_Video_, _Stream_, _Blob_ and alike, use [image-pixels](https://ghub.io/image-pixels):\n\n```js\nconst equal = require('image-equal')\nconst load = require('image-pixels')\nequal(await load('./a.png'), await load('./b.png')),\n```\n\n#### `diff`\n\nCan be one of:\n\nType | Meaning\n---|---\n`Bool` | Show diff data to console, by default `false`.\n`console` | Send diff data to console, same as `true`.\n`Canvas2D`, `Context2D` | Put diff pixels to a canvas.\n`document`, `Element` | Create a canvas in `document`/`element` with diff pixels.\nfilename `String` | Write diff data to a file or filepath. In browser downloads the file.\n`ImageData` | Write diff data to _ImageData_ object.\n`Array`, `TypedArray` | Write diff pixels data to target array.\n`Stream` | Send data to stream, eg. `process.stdout` (acts the same as `console`).\n`Function` | Call function with diff data object.\n`Object` | Put diff stats into object: `diff.data` for diff pixels, `diff.count` for number of diff pixels, `diff.ids` for diff pixel ids and `diff.amount` for amount of difference between images, `0..1`.\n\n#### `options`\n\nProperty | Meaning\n---|---\n`antialias` | Include antialias, by default `false`.\n`threshold` | Sensitivity to px difference, 0 - intolerant, 1 - not sensitive. By default `0.1`.\n`clip` | A sub-area to compare, rectangle `[left, top, width, height]`.\n\n## See also\n\n* [image-pixels](https://ghub.io/image-pixels) — load or save pixel data from any source.\n* [image-output](https://ghub.io/image-output) — output pixels data into any destination.\n* [pixelmatch](https://ghub.io/pixelmatch) − fuzzy image comparison tool.\n\n## Credits\n\n© 2018 Dmitry Yv. MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdy%2Fimage-equal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdy%2Fimage-equal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdy%2Fimage-equal/lists"}