Documentation ¶
Overview ¶
Package cmpimg compares the raw representation of images taking into account idiosyncracies related to their underlying format (SVG, PDF, PNG, ...).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var GenerateTestData = flag.Bool("regen", false, "Uses the current state to regenerate the test data.")
Functions ¶
func CheckPlot ¶
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.
func Diff ¶
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.
Types ¶
This section is empty.