how to combine two different images in matlab?

 Accepted Answer

newimage = image1 + image2;
Unless the two images are not the same size. Or unless you do not mean "add" in the arithmetic sense and instead mean something like "put them side by side".

2 Comments

If they're integers (uint8 or uint16), cast to double to prevent clipping.
Regarding Walter's display suggestion, try imshowpair(), imfuse(), or montage().
Ashok didn't say anything about wanting to prevent clipping. I suspect Ashok has not thought about that problem.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!