How to change the color of a 16bit image from Grays to a color mode?
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Shirley
am 12 Sep. 2019
Kommentiert: Shirley
am 17 Sep. 2019
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
0 Kommentare
Akzeptierte Antwort
Shirley
am 12 Sep. 2019
Bearbeitet: Walter Roberson
am 12 Sep. 2019
2 Kommentare
Image Analyst
am 13 Sep. 2019
Or, vectorized:
YellowColormap = gray(256);
YellowColormap(:,3) = 0;
Weitere Antworten (1)
Walter Roberson
am 12 Sep. 2019
image_as_rgb = repmat(image_as_gray, [1 1 3]);
Now you can manipulate image_as_rgb .
Or you might prefer to use ind2rgb() -- though to do that you need to define a colormap that has as many entries as max(image_as_gray)+1, which for a 16 bit image could be as many as 65536 entries.
5 Kommentare
Walter Roberson
am 15 Sep. 2019
yellow_image = cat(3, repmat(mat2gray(image_as_gray), [1 1 2]), zeros(size(image_as_gray)));
imshow(yellow_image)
You have a uint16 image, but your data range is only a small fraction of uint16.
Siehe auch
Kategorien
Mehr zu Orange finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!