graymap-difference

Synopsis

(graymap-difference graymap1 graymap2)

Parameters

  • graymap1
  • graymap2

Description

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.

Side Effects

Return Value

The resulting graymap is returned.

Example

> (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:

horses-gray.png

horses-gray2.png

horses-graydiff.png