Package cmpimg compares the raw representation of images taking into account idiosyncracies related to their underlying format (SVG, PDF, PNG, ...).
CheckPlot checks a generated plot against a previously created reference. If generateTestData = true, it regenerates the reference. For image.Image formats, a base64 encoded png representation is output to the testing log when a difference is identified.
Diff calculates an intensity-scaled difference between images a and b and places the result in dst, returning the intersection of a, b and dst. It is the responsibility of the caller to construct dst so that it will overlap with a and b. For the purposes of Diff, alpha is not considered.
Diff is not intended to be used for quantitative analysis of the difference between the input images, but rather to highlight differences between them for testing purposes, so the calculation is rather naive.
Equal takes the raw representation of two images, raw1 and raw2, together with the underlying image type ("eps", "jpeg", "jpg", "pdf", "png", "svg", "tiff"), and returns whether the two images are equal or not.
Equal may return an error if the decoding of the raw image somehow failed.