| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Image Processing Toolbox |
| Contents | Index |
| Learn more about Image Processing Toolbox |
Z = imadd(X,Y)
Z = imadd(X,Y) adds each element in array X with the corresponding element in array Y and returns the sum in the corresponding element of the output array Z. X and Y are real, nonsparse numeric arrays with the same size and class, or Y is a scalar double. Z has the same size and class as X, unless X is logical, in which case Z is double.
If X and Y are integer arrays, elements in the output that exceed the range of the integer type are truncated, and fractional values are rounded.
Note On Intel architecture processors, imadd can take advantage of the Intel Integrated Performance Primitives (Intel IPP) library, thus accelerating its execution time. The Intel IPP library is activated if arrays X, Y, and Z are of class logical, uint8, or single and are of the same class. The Intel IPP library is also activated if Y is a double scalar and arrays X and Z are uint8, int16, or single and are of the same class. |
Add two uint8 arrays. Note the truncation that occurs when the values exceed 255.
X = uint8([ 255 0 75; 44 225 100]);
Y = uint8([ 50 50 50; 50 50 50 ]);
Z = imadd(X,Y)
Z =
255 50 125
94 255 150Add two images together and specify an output class.
I = imread('rice.png');
J = imread('cameraman.tif');
K = imadd(I,J,'uint16');
imshow(K,[])Add a constant to an image.
I = imread('rice.png');
J = imadd(I,50);
subplot(1,2,1), imshow(I)
subplot(1,2,2), imshow(J)imabsdiff, imcomplement, imdivide, imlincomb, immultiply, imsubtract, ippl
![]() | imabsdiff | imadjust | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |