Starting with a grayscale image, how can I colour a certain pixel based on its x,y coordinates?
7 次查看(过去 30 天)
显示 更早的评论
I have a 256 by 256 grayscale image. I want to colour a certain coordinating (say 125,125) red. Do I need to convert the entire image into truecolour? I want to keep the greyscale image how it was other than the coloured pixel. Would gray2ind seems like the appropiate first step, but I'm not sure how to go from there.
Thanks in advanced!
2 个评论
John BG
2017-6-29
you don't have to convert the image to true color, but you can if the only code available you use can only work in one specific image format. Changing image format is easy in MATLAB.
Would you please supply a sample image so readers can show you different ways to alter single pixels.
回答(1 个)
Swarooph
2017-6-29
编辑:Swarooph
2017-6-29
Note that grayscale images cannot have color pixels by definition. If you are just interested in marking a pixel with a marker you can use the plot function as discussed in the above answer's comments or use the insertMarker function.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!