[cairo] A better image comparison tool

Charles Doutriaux doutriaux1 at llnl.gov
Mon Sep 22 12:39:30 PDT 2008

Hi All,

I'm looking at this email and I'm really interested in this. I'm 
actually wondering if there's any way already in cairo to compare to 
files (ps or png or svg). I'm asking this because I'm trying to do this 
in our test suite and I would like to have a fairly automated way to see 
if the images generated by our software are consistent across platforms 
and bug fixes.

Thank you very much,


Ralph Giles wrote:
> On Mon, Sep 22, 2008 at 11:53 AM, Antoine Azar <cairo at antoineazar.com> wrote:
>> I am considering a couple approaches. The first one I want to try out is a
>> pretty simple square sum of differences or sum of absolute differences.
>> There are more fancy algorithms like cross correlation and mutual
>> information,  which I'll probably try out too. We can then set custom
>> thresholds for what should appear as "OK", "Warning" and "Error".
> We'd be interested to hear how this goes. The problem we've had with a
> lot of these measures is that the were developed for image recognition
> and video compression applications and don't apply well to
> high-contrast vector graphics
> We use a threshold+cluster tool to cull single-pixel differences in
> our regression tests for ghostscript. It counts the number of pixels
> whose values differ by more than a threshold value, and then counts
> how many of those are in clusters larger than a particular window
> size.
> Implementation is here if you want to try it out:
>   http:// svn.ghostscript.com/ghostscript/trunk/gs/toolbin/tests/fuzzy.c
> Note the 'make a diff image' feature is currently broken. It expect
> the input files to be in bmp or ppm format.
>  -r
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http:// lists.cairographics.org/mailman/listinfo/cairo

More information about the cairo mailing list