(graymap-difference graymap1 graymap2)
This procedure creates a new 16 bit graymap by computing the absolute difference for each pixel. The two suppied graymaps need to have the same dimensions, otherwise an error is signalled. The absolute difference for each resulting pixel is computed by subtracting the smaller value from the larger.
The resulting graymap is returned.
> (define a (graymap-readpng "horses-gray.png")) a > (define b (graymap-readpng "horses-gray2.png")) b > (define c (graymap-difference a b)) c > (graymap-writepng c "horses-graydiff.png") ok >
The three PNG images refenced with this example display as follows: