{"id":14384779,"url":"https://github.com/argos-ci/image-difference","last_synced_at":"2025-08-23T18:30:49.485Z","repository":{"id":57271996,"uuid":"95971281","full_name":"argos-ci/image-difference","owner":"argos-ci","description":"Create image differential between two images","archived":true,"fork":false,"pushed_at":"2022-10-07T06:45:03.000Z","size":1440,"stargazers_count":18,"open_issues_count":0,"forks_count":4,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-12-16T16:02:19.888Z","etag":null,"topics":["difference","image"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"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/argos-ci.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-01T15:09:04.000Z","updated_at":"2024-06-26T23:12:04.000Z","dependencies_parsed_at":"2022-08-25T06:43:05.521Z","dependency_job_id":null,"html_url":"https://github.com/argos-ci/image-difference","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/argos-ci%2Fimage-difference","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/argos-ci%2Fimage-difference/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/argos-ci%2Fimage-difference/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/argos-ci%2Fimage-difference/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/argos-ci","download_url":"https://codeload.github.com/argos-ci/image-difference/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230720915,"owners_count":18270476,"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":["difference","image"],"created_at":"2024-08-28T18:01:40.008Z","updated_at":"2024-12-21T13:30:20.499Z","avatar_url":"https://github.com/argos-ci.png","language":"JavaScript","readme":"# image-difference\n\n\u003e :warning: **This project is deprecated and no longer maintained.**\n\n\u003e Create image differential between two images\n\n[![npm package](https://img.shields.io/npm/v/image-difference.svg)](https://www.npmjs.org/package/image-difference)\n[![Build Status](https://travis-ci.org/argos-ci/image-difference.svg?branch=master)](https://travis-ci.org/argos-ci/image-difference)\n\n[![PeerDependencies](https://img.shields.io/david/peer/argos-ci/image-difference.svg)](https://david-dm.org/argos-ci/image-difference#info=peerDependencies\u0026view=list)\n[![Dependencies](https://img.shields.io/david/argos-ci/image-difference.svg)](https://david-dm.org/argos-ci/image-difference)\n[![DevDependencies](https://img.shields.io/david/dev/argos-ci/image-difference.svg)](https://david-dm.org/argos-ci/image-difference#info=devDependencies\u0026view=list)\n\n## The problem solved\n\n![difference](example/example.png)\n\nThis is a fork of [image-diff](https://github.com/uber-archive/image-diff) that is no longer maintained.\nThis was created as part of a [visual regression](http://www.youtube.com/watch?v=1wHr-O6gEfc) project and now supported as part of [Argos-CI](https://www.argos-ci.com/).\n\n## Installation\n\n`image-difference` depends on [ImageMagick](http://www.imagemagick.org/script/index.php) Please install this before continuing.\n\n```sh\nnpm install --save image-difference\n```\n\n## API\n\n### `imageDifference(options) =\u003e Promise`\n\nCreate image differential between two images\n\n#### Arguments\n\n1. `options` (*Object*)\n    - `options.metric` (*String*, default to `AE`): Optional metric used for the computation of the output.\n        - [documentation](http://legacy.imagemagick.org/script/command-line-options.php#metric)\n        - [guide](http://www.imagemagick.org/Usage/compare/)\n        - [implementation](https://github.com/ImageMagick/ImageMagick/blob/master/MagickCore/compare.c)\n    - `options.actualFilename` (*String*): Path to actual image file. **must** exist.\n    - `options.expectedFilename` (*String*): Path to expected image file. **must** exist.\n    - `options.diffFilename` (*String*): Optional path to output differential image.\n\n#### Returns\n\n`Promise`: Return the output of the process. It's an object that contains the `width`, `height` properties.\n\nAlso, depending on the metric used, we either returns `value` or `value 1`, `value2`, `valueX`.\nThose values are in the order of the ImageMagick output.\nFor instance, with the default `AE` metric, `value` is the number of different pixels after the `fuzz` being applied.\n\n#### [Example](https://github.com/argos-ci/image-difference/tree/master/example)\n\n```js\nimport imageDifference from '../src/imageDifference'\n\nimageDifference(\n  {\n    actualFilename: `${__dirname}/images/hello-world.png`,\n    expectedFilename: `${__dirname}/images/hello.png`,\n    diffFilename: `${__dirname}/images/hello-diff.png`,\n  },\n  console.log\n)\n```\n\n## CLI Usage\n\n```sh\nUsage:  [options] \u003cactual-filename\u003e \u003cexpected-filename\u003e [diff-filename]\n\nCreate image differential between two images\n\nOptions:\n\n  -h, --help     output usage information\n  -V, --version  output the version number\n```\n\n\n## Benchmark\n\nWe use `imagemagick1` as the default implmentation\n\n```sh\nimage-diff diff x 1.11 ops/sec ±1.21% (25 runs sampled)\nimage-diff same x 1.07 ops/sec ±0.80% (25 runs sampled)\n\nimage-difference imagemagick1 diff x 4.43 ops/sec ±0.40% (41 runs sampled)\nimage-difference imagemagick1 same x 4.45 ops/sec ±0.49% (41 runs sampled)\n\nimage-difference imagemagick2 diff x 2.96 ops/sec ±0.49% (34 runs sampled)\nimage-difference imagemagick2 same x 2.94 ops/sec ±0.87% (34 runs sampled)\n\nimage-difference graphicsmagick diff x 2.32 ops/sec ±0.60% (31 runs sampled)\nimage-difference graphicsmagick same x 2.30 ops/sec ±0.72% (31 runs sampled)\n\npixelmatch diff x 0.79 ops/sec ±0.94% (23 runs sampled)\npixelmatch same x 3.58 ops/sec ±2.07% (37 runs sampled)\n\nresemble diff x 0.59 ops/sec ±4.76% (22 runs sampled)\nresemble same x 0.94 ops/sec ±0.85% (24 runs sampled)\n\nlooksSame diff x 2.09 ops/sec ±3.08% (30 runs sampled)\nlooksSame same x 1.08 ops/sec ±3.76% (25 runs sampled)\n```\n\n## Contributing\n\n```sh\nbrew install imagemagick@6 graphicsmagick\nyarn\nyarn test:watch\n```\n\n## License\n\nMIT\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fargos-ci%2Fimage-difference","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fargos-ci%2Fimage-difference","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fargos-ci%2Fimage-difference/lists"}