MATLAB: Put color to a gray image

gray to color

Hi,
I need help to make this, I have a gray image and I need to put 3 diferent colors in it, something like this.
Thank you.

Best Answer

gray_as_RGB = repmat(YourGrayImage, [1 1 3]);
now gray_as_RGB is the RGB equivalent of the grayscale image and you can write color information into it.