{"id":15066788,"url":"https://github.com/ryancyq/rodiff","last_synced_at":"2026-03-03T21:01:56.396Z","repository":{"id":255858925,"uuid":"852732634","full_name":"ryancyq/rodiff","owner":"ryancyq","description":"A ruby image comparison tool powered by ODiff in OCamel.","archived":false,"fork":false,"pushed_at":"2025-03-23T02:52:43.000Z","size":5976,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T03:26:08.312Z","etag":null,"topics":["diff","image-comparison","odiff","ruby","snapshot","visual"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/ryancyq.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-05T10:23:56.000Z","updated_at":"2025-03-23T02:51:50.000Z","dependencies_parsed_at":"2024-09-29T11:24:24.160Z","dependency_job_id":"d3d31ea7-9595-42d2-b581-37e1acc277a0","html_url":"https://github.com/ryancyq/rodiff","commit_stats":null,"previous_names":["ryancyq/rodiff"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryancyq%2Frodiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryancyq%2Frodiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryancyq%2Frodiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryancyq%2Frodiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryancyq","download_url":"https://codeload.github.com/ryancyq/rodiff/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248229065,"owners_count":21068819,"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":["diff","image-comparison","odiff","ruby","snapshot","visual"],"created_at":"2024-09-25T01:12:07.000Z","updated_at":"2026-03-03T21:01:56.391Z","avatar_url":"https://github.com/ryancyq.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rodiff\n\n[![Version][rubygems_badge]][rubygems]\n[![CI][ci_badge]][ci_workflows]\n[![Coverage][coverage_badge]][coverage]\n[![Maintainability][maintainability_badge]][maintainability]\n\nA ruby image comparison tool powered by [Odiff](https://github.com/dmtrKovalenko/odiff) in OCamel.\n\n## Motivation\n\nImpressive [benchmarks](https://github.com/dmtrKovalenko/odiff#benchmarks) from `Odiff`.\n\nA strong candidate against the veteran players like [pixelmatch](https://github.com/mapbox/pixelmatch) and [ImageMagick](https://github.com/ImageMagick/ImageMagick)\n\n## Getting Started\n\nInstall the gem and add to the application's Gemfile by executing:\n```sh\nbundle add rodiff\n```\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n```sh\ngem install rodiff\n```\n\nThis gem wraps the [standalone executable](https://github.com/dmtrKovalenko/odiff#from-binaries) of the `Odiff`. These executables are platform specific, there are separate gems per platform, but the suitable gem will automatically be selected for your machine.\n\nSupported platforms are:\n- arm64-darwin (macos-arm64)\n- x64-mingw32 (windows-x64)\n- x64-mingw-ucrt (windows-x64)\n- x86_64-darwin (macos-x64)\n- x86_64-linux (linux-x64)\n\n### Using a local installation of `Odiff`\n\nIf you are not able to use the vendored standalone executables, a local installation of the `Odiff` executable can be configured by setting an environment variable named `ODIFF_INSTALL_DIR` to the directory path containing the executable.\n\nFor example, if you've installed the [`odiff-bin`](https://github.com/dmtrKovalenko/odiff#cross-platform) npm package and had the binaries downloaded at `/path/to/node_modules/bin/odiff`, then you should set your environment variable like so:\n\n``` sh\nODIFF_INSTALL_DIR=/path/to/node_modules/bin\n```\n\nor, for relative paths like `./node_modules/.bin/odiff`:\n\n``` sh\nODIFF_INSTALL_DIR=node_modules/.bin\n```\n\n## Configuration\n\nRodiff automatically discovers and loads configuration from `.rodiff.yml` files in your project.\n\n### Configuration File Discovery\n\nRodiff searches for `.rodiff.yml` starting from the current directory and traversing upward to your home directory:\n\n```\n/home/username/projects/myapp/src/tests/.rodiff.yml  ← checks here first\n/home/username/projects/myapp/src/.rodiff.yml\n/home/username/projects/myapp/.rodiff.yml            ← typically found here\n/home/username/projects/.rodiff.yml\n/home/username/.rodiff.yml                            ← stops here (home directory)\n```\n\n### Configuration Options\n\nCreate a `.rodiff.yml` file in your project root:\n\n```yaml\n# File patterns for image comparison (supports glob patterns)\ninclude_pattern: \"screenshots/**/*.png\"\nexclude_pattern: \"screenshots/archived/**\"\n\n# Comparison settings\ncolor_threshold: 0.1          # 0.0 - 1.0 (lower = stricter)\nignore_antialiasing: false    # Ignore antialiasing differences\noutput_diff_mask: false       # Output black/white mask instead of diff image\n\n# Error handling\nfail_if_no_comparison: false  # Exit with error if no images found\nexit_code_error: 1           # Exit code for errors (not image differences)\n```\n\n### Programmatic Configuration\n\nYou can also configure Rodiff programmatically:\n\n```ruby\nRodiff.configure do |config|\n  config.include_pattern = \"**/*.png\"\n  config.color_threshold = 0.15\n  config.ignore_antialiasing = true\nend\n```\n\nOr override specific values:\n\n```ruby\nconfig = Rodiff::Configuration.new\nconfig.overrides(\n  color_threshold: 0.2,\n  output_diff_mask: true\n)\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Troubleshooting\n\n### `ERROR: Cannot find the odiff executable` for supported platform\n\nSome users are reporting this error even when running on one of the supported platforms:\n- arm64-darwin\n- x64-mingw32\n- x64-mingw-ucrt\n- x86_64-darwin\n- x86_64-linux\n\n#### Check Bundler PLATFORMS\n\nA possible cause of this is that Bundler has not been told to include gems for your current platform. Please check your `Gemfile.lock` file to see whether your native platform is included in the `PLATFORMS` section. If necessary, run:\n\n``` sh\nbundle lock --add-platform \u003cplatform-name\u003e\n```\n\nand re-bundle.\n\n\n#### Check BUNDLE_FORCE_RUBY_PLATFORM\n\nAnother common cause of this is that bundler is configured to always use the \"ruby\" platform via the\n`BUNDLE_FORCE_RUBY_PLATFORM` config parameter being set to `true`. Please remove this configuration:\n\n``` sh\nbundle config unset force_ruby_platform\n# or\nbundle config set --local force_ruby_platform false\n```\n\nand re-bundle.\n\nSee https://bundler.io/man/bundle-config.1.html for more information.\n\n## License\n\nRodiff is released under the [MIT License](https://opensource.org/licenses/MIT).\nOdiff is released under the [MIT License](https://opensource.org/licenses/MIT).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at [https://github.com/ryancyq/rodiff](https://github.com/ryancyq/rodiff).\n\n[rubygems_badge]: https://img.shields.io/gem/v/rodiff.svg\n[rubygems]: https://rubygems.org/gems/rodiff\n[ci_badge]: https://github.com/ryancyq/rodiff/actions/workflows/ci.yml/badge.svg\n[ci_workflows]: https://github.com/ryancyq/rodiff/actions/workflows/ci.yml\n[coverage_badge]: https://codecov.io/gh/ryancyq/rodiff/graph/badge.svg?token=SYR7FSDWT5\n[coverage]: https://codecov.io/gh/ryancyq/rodiff\n[maintainability_badge]: https://api.codeclimate.com/v1/badges/d5b1002a1a7162f86a7a/maintainability\n[maintainability]: https://codeclimate.com/github/ryancyq/rodiff/maintainability\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryancyq%2Frodiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryancyq%2Frodiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryancyq%2Frodiff/lists"}