how to display a grayscale image in a monochrome color (other than white)
I have a grayscale image consisting of a matrix of 512×512 int16 numbers. If I run
figure;imshow(imagedata,[])
I can see my contrast adjusted image. Now all I want to do is to display this image by replacing white with green. I do not want to change the datatype to double or do something that would mess with the original data.
My first thought was to just look at the colormap and ideally that should look like
[0 0 0]
[1 1 1]
….
[255 255 255]
I thought I could just change that to be
[0 0 0]
[0 1 0]
…..
[0 255 0]
but when I take a look at the colormap of this grayscale image,
map = colormap;
the colormap has non-zero numbers (which are not equal to each other) in each of the r,g and b columns and so I don’t understand this. The grayscale colormap is supposed to have the same numbers in the r,g and b columns.
All I want to do is to tell matlab that the highest number maps to green instead of white. What is the easiest way of doing this?I have a grayscale image consisting of a matrix of 512×512 int16 numbers. If I run
figure;imshow(imagedata,[])
I can see my contrast adjusted image. Now all I want to do is to display this image by replacing white with green. I do not want to change the datatype to double or do something that would mess with the original data.
My first thought was to just look at the colormap and ideally that should look like
[0 0 0]
[1 1 1]
….
[255 255 255]
I thought I could just change that to be
[0 0 0]
[0 1 0]
…..
[0 255 0]
but when I take a look at the colormap of this grayscale image,
map = colormap;
the colormap has non-zero numbers (which are not equal to each other) in each of the r,g and b columns and so I don’t understand this. The grayscale colormap is supposed to have the same numbers in the r,g and b columns.
All I want to do is to tell matlab that the highest number maps to green instead of white. What is the easiest way of doing this? I have a grayscale image consisting of a matrix of 512×512 int16 numbers. If I run
figure;imshow(imagedata,[])
I can see my contrast adjusted image. Now all I want to do is to display this image by replacing white with green. I do not want to change the datatype to double or do something that would mess with the original data.
My first thought was to just look at the colormap and ideally that should look like
[0 0 0]
[1 1 1]
….
[255 255 255]
I thought I could just change that to be
[0 0 0]
[0 1 0]
…..
[0 255 0]
but when I take a look at the colormap of this grayscale image,
map = colormap;
the colormap has non-zero numbers (which are not equal to each other) in each of the r,g and b columns and so I don’t understand this. The grayscale colormap is supposed to have the same numbers in the r,g and b columns.
All I want to do is to tell matlab that the highest number maps to green instead of white. What is the easiest way of doing this? image processing, colormap MATLAB Answers — New Questions