vdiffr icon indicating copy to clipboard operation
vdiffr copied to clipboard

Add expect_doppelganger_raster() for raster-based comparisons?

Open clauswilke opened this issue 5 years ago • 1 comments

I am wondering whether it would be possible to add a separate expect function for raster-based comparisons, e.g. expect_doppelganger_raster(). This issue is related to but somewhat different from #1 and #31, which I read as implementing an automatic fallback to raster-based comparison. I would like to make the raster-based comparison an explicit request by the person writing the testing library.

The reason I'm proposing this is that we're encountering an increasing number of cases where we know ahead of time that svg comparison will fail. One example is geom_sf() in ggplot2. The exact output will depend on the current version of sf, even if the produced graphics are visually identical. Another case I've run into is with the isoband package (https://github.com/clauswilke/isoband). It uses a hashmap for polygon manipulations and its exact output depends on the C++ system libraries, even if the resulting polygons are mathematically equivalent. (Things that are undefined are the order of polygons in the draw stack and the start/end point for closed polygon rings.) In those cases, if I could set up a bitmap-based comparison, even with a very generous tolerance to avoid false positives, it would be a huge step forward over no automated comparison at all.

clauswilke avatar Feb 04 '19 16:02 clauswilke

I'm seeing issues of the sort cropping up under different BLASs producing changes that are causing a second decimal place difference in the textual diff of the SVG but are which show zero visual difference what so ever.

gavinsimpson avatar Jan 14 '20 22:01 gavinsimpson