ImageMath combines two images mathematically: an “input” image and an “op” (operation) image. In this example, the links show that the image on the left of ImageMath is the input image and the image on top is the op image. The operation is div, so the output is the input image divided by the op image.
| Operation | Output at each pixel |
|---|---|
| add, sub, mul, div | input + op, input − op, input × op, input ÷ op |
| max, min | the larger or the smaller of the two values |
| mod | (input − op) ÷ (input + op), a modulation between −1 and 1 |
| atan2 | the arctangent of the ratio of the two images. It enhances low-contrast information, increasing the contrast of dim values and suppressing that of bright values |
0.5 0.5 with add averages the two images.The two images must be the same size. The operation is applied to each band separately. If both images have more than one band, they must have the same number of bands. If one image has a single band, it is applied to each band of the other. The output is floating point.