MATLAB: How to change the color of a 16bit image from Grays to a color mode

colorMATLAB

Hi
I have an image which is 16bit. It is grays. I wonder how can I change it to a specific color, e.g, Yellow? I tried to convert it to RGB first, but somehow [I,map]=imread(16bitimage) doesn't give the colormap.
Thanks a lot

Best Answer

I found that this works for me. Suggestions are more than welcome. Thanks
1)self define a colormap, e.g
%Yellow [1 1 0]
YellowColormap=zeros(256,3);
for i=1:256
YellowColormap(i,1) = (i-1)/256;
YellowColormap(i,2) = (i-1)/256;
end
2)X=imread(16bit image);
imshow(X,'DisplayRange',[0 65535],'Colormap',YellowColorMap)
Related Question