MATLAB: Binary image to RGB image

binarycolorizeImage Processing Toolboxmask

Hi all,
I would like to know how to convert binary image to RGB. Let say, I want WHITE become RED and BLACK become GREEN. Anyone can help me please…really need any suggestion.
Thank you

Best Answer

RGBIMG = cat(3, IMG, ~IMG, zeros(size(IMG)));