{"id":28550743,"url":"https://github.com/dropbox/differ","last_synced_at":"2025-08-28T08:07:47.675Z","repository":{"id":40422573,"uuid":"452478765","full_name":"dropbox/differ","owner":"dropbox","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-04T13:48:37.000Z","size":7616,"stargazers_count":78,"open_issues_count":0,"forks_count":5,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-06-10T03:16:44.706Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dropbox.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","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":"2022-01-26T23:48:03.000Z","updated_at":"2025-03-05T21:18:30.000Z","dependencies_parsed_at":"2024-09-16T21:17:43.721Z","dependency_job_id":"555dc7b3-5b3e-4963-a098-32be641f10a0","html_url":"https://github.com/dropbox/differ","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dropbox/differ","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Fdiffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Fdiffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Fdiffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Fdiffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dropbox","download_url":"https://codeload.github.com/dropbox/differ/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Fdiffer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272467095,"owners_count":24939516,"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","status":"online","status_checked_at":"2025-08-28T02:00:10.768Z","response_time":74,"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":"2025-06-10T03:10:13.964Z","updated_at":"2025-08-28T08:07:47.667Z","avatar_url":"https://github.com/dropbox.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Differ\n\nDiffer is a multiplatform image diffing library that's designed to be lightweight and flexible.\n\nDiffer's default `ImageComparator`, `SimpleImageComparator`, does basic per-pixel\n[Euclidean distance](https://en.wikipedia.org/wiki/Color_difference) comparisons, returning a result of\nthe number of pixels whose distance is greater than the provided `maxDistance`. An optional shift value\ncan be applied both horizontally and vertically, to allow the comparator to account for differences which\nare the result of anti-aliasing errors.\n\n## Usage\n\nThe simplest comparison simply takes two Images and returns a result that has the number of pixels that\nare different between the two.\n\n```kotlin\nval differ = SimpleImageComparator()\nval result = differ.compare(left, right)\n\nif (result.pixelDifferences \u003e 0) {\n    println(\"Images are different.\")\n} else {\n    println(\"Images are identical.\")\n}\n```\n\n`SimpleImageComparator` can be configured to adjust the sensitivity of it's comparison using the `maxDistance`\nproperty, which defines the max distance that two colors can be from each other in 4 dimensional space without\ntriggering a difference.\n\n```kotlin\n// This comparator will be more lenient than the default.\nval differ = SimpleImageComparator(maxDistance = 0.007)\nval result = differ.compare(left, right)\n\nif (result.pixelDifferences \u003e 0) {\n    println(\"Images are different.\")\n} else {\n    println(\"Images are identical.\")\n}\n```\n\n### Anti-Aliasing Support\n\nIf bitmap images are resized, it's common for some pixels to have minor differences not because the underlying\nimage differs, but because of anti-aliasing errors, as pixels are approximated.\n\n`SimpleImageComparator` allows you to compensate for this by allowing you to define a horizontal and vertical\nshift, which allows the comparator to take neighboring pixels within the shift window into account when comparing\npixels.\n\n```kotlin\n// This comparator will use the neighboring 2 pixels, both horizontally and vertically,\n//  to account for potential anti-alias issues.\nval differ = SimpleImageComparator(hShift = 2, vShift = 2)\nval result = differ.compare(left, right)\n\nif (result.pixelDifferences \u003e 0) {\n    println(\"Images are different.\")\n} else {\n    println(\"Images are identical.\")\n}\n```\n\n\u003e Note that adding a shift window can potentially increase comparison times exponentially, since for every pixel that doesn't immediately match the comparator will compare another 2 pixels for every shift value.\n\n## License\n\n    Copyright (c) 2022 Dropbox, Inc.\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n        http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropbox%2Fdiffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdropbox%2Fdiffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropbox%2Fdiffer/lists"}