R bindings to the Odiff command-line tool for blazing-fast, pixel-by-pixel image comparison. Ideal for visual regression testing, quality assurance, and validated environments.
compare_images()High-level image comparison returning a tibble/data.frame. Accepts file paths or magick-image objects.
odiff_run()Low-level CLI wrapper with full control over all Odiff options. Returns a detailed result list.
ignore_region()Helper to create ignore region specifications.
find_odiff()Locate the Odiff binary using priority search.
odiff_available()Check if Odiff is available.
odiff_version()Get the Odiff version string.
odiff_info()Display full configuration information.
odiffr_update()Download latest Odiff binary to user cache. Useful for updating between package releases.
odiffr_cache_path()Get the cache directory path.
odiffr_clear_cache()Remove cached binaries.
The package searches for the Odiff binary in this order:
User-specified path via options(odiffr.path = "/path/to/odiff")
System PATH (Sys.which("odiff"))
Cached binary from odiffr_update()
PNG, JPEG, WEBP, TIFF (cross-format comparison supported)
PNG only
Images match
Layout difference (different dimensions)
Pixel differences found
The package is designed for use in validated pharmaceutical and clinical research environments:
Pin specific binary versions with options(odiffr.path = "/validated/odiff")
Zero external runtime dependencies (base R only for core functions)
Use odiff_version() to document binary version for audit trails
Ben Wolstenholme
https://github.com/dmtrKovalenko/odiff - Odiff project
https://github.com/BenWolst/odiffr - Odiffr package
Maintainer: Ben Wolstenholme odiffr@benwolst.dev
Useful links: