part color part black and white
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Douglas Brenner
el 25 de Oct. de 2016
Comentada: Walter Roberson
el 25 de Oct. de 2016
I have a grayscale image. I want to change some pixels to colored pixels. How do I do that? thanks
1 comentario
Chaya N
el 25 de Oct. de 2016
Editada: Chaya N
el 25 de Oct. de 2016
What kind of changes were you seeking to do?
Did you want to color certain areas of your image? or did you want to simply draw colored outlines around these areas?
An attached image and a few details by way of explanation would be most useful here!
Respuesta aceptada
Walter Roberson
el 25 de Oct. de 2016
You need to convert the grayscale to equivalent (gray-toned) RGB image, after which you can add color to the image.
newRGBimage = YourGrayImage(:,:,[1 1 1]); %a fast way of copying the image to three color planes
newRGBimage(:,[1 end], 1) = 255; %draw a red left and right border
2 comentarios
Walter Roberson
el 25 de Oct. de 2016
Small correction:
newRGBimage(:,[1 end], 1) = 255; %draw a red left and right border
newRGBimage(:,[1 end], 2:3) = 0;
If your image is double instead of uint8 then change the 255 to 1.0
Más respuestas (0)
Ver también
Categorías
Más información sobre Biomedical Imaging en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!