I'm wondering how to change the color of a grayscale image to rgb. In particular given a grayscale image, obtained form mat2gray(matrix), i would like to assign a specific color (e.g. green) to those pixels with a gray value in a specific range and the color red to the other pixels. I'm using the map jet(255) with imshow but i'm not satisfied of the result. I would like to choose the threshold in order to select pixels to assign green color and pixels to assign red.