Learn R Programming

odiffr (version 0.5.1)

odiffr-package: Odiffr: Fast Pixel-by-Pixel Image Comparison

Description

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.

Arguments

Main Functions

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.

Binary Management

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.

Binary Detection Priority

The package searches for the Odiff binary in this order:

  1. User-specified path via options(odiffr.path = "/path/to/odiff")

  2. System PATH (Sys.which("odiff"))

  3. Cached binary from odiffr_update()

Supported Image Formats

Input

PNG, JPEG, WEBP, TIFF (cross-format comparison supported)

Output

PNG only

Exit Codes

0

Images match

21

Layout difference (different dimensions)

22

Pixel differences found

For Validated Environments

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

Author

Ben Wolstenholme

Author

Maintainer: Ben Wolstenholme odiffr@benwolst.dev

See Also