Function File: out = imadd (a, b)
Function File: out = imadd (a, b, class)

Add image or constant to an image.

If a and b are two images of same size and class, the images are added. Alternatively, if b is a floating-point scalar, its value is added to the image a.

The class of out will be the same as a unless a is logical in which case out will be double. Alternatively, it can be specified with class.

Note 1: you can force output class to be logical by specifying class. This is incompatible with MATLAB which will not honour request to return a logical matrix.

Note 2: the values are truncated to the maximum value of the output class.

See also: imabsdiff, imcomplement, imdivide, imlincomb, immultiply, imsubtract.

Package: image