Why does my image does not conert to grayscale?
34 次查看(过去 30 天)
显示 更早的评论
I need to convert an image that we were given to grayscale.
I wrote the code below. When I highlight the whole 'imagesc' line and 'evaluate selction' the image pops up but in color.
logo = imread('..._logo.jpg');
figure;
imagesc(logo);
colormap gray;
0 个评论
采纳的回答
Image Analyst
2021-8-31
Use imshow() because imagesc() applies some funky colormap by default, and that is usually not what you want.
3 个评论
Image Analyst
2021-8-31
No, you don't need that last line. The default for gray scale images is to not use a colormap and show everything in it's original, native gray color.
Image Analyst
2021-9-5
Andrew, if this solved it, can you click the "Accept this answer" link? Thanks in advance.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Orange 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!