Skip to contents

Display the baseline, current and diff images of an odiff_run() result in the current graphics device, using base graphics.

Usage

# S3 method for class 'odiff_result'
plot(x, which = c("all", "diff", "baseline", "current"), ...)

Arguments

x

An odiff_result object returned by odiff_run().

which

Which image(s) to show: "all" (default) shows the baseline, current and diff images side by side; "diff", "baseline" or "current" show a single image.

...

Currently unused.

Value

x, invisibly.

Details

PNG images are read with png::readPNG() (the png package must be installed). Other formats (JPEG, WEBP, TIFF, ...) are read with the magick package if it is installed.

A diff image is only available when the comparison was run with diff_output and the images differ; otherwise the diff panel says "No diff image".

The graphical parameters (par()) are restored on exit.

For data-frame results of compare_images() or a row of a batch, use diff_image() to get the diff image.

Examples

if (FALSE) { # \dontrun{
result <- odiff_run("baseline.png", "current.png", diff_output = "diff.png")
plot(result)
plot(result, which = "diff")
} # }