フィルターのクリア

why color image is getting displayed as gray image

1 回表示 (過去 30 日間)
Elysi Cochin
Elysi Cochin 2015 年 4 月 13 日
編集済み: Stephen23 2015 年 4 月 13 日
i have a color image, when i display it shows as gray image, when i check the size also it shows as d = 1;
Img = imread('Afternoon Rain.bmp');
figure; imshow(Img);
how and why does it come like that...

採用された回答

Stephen23
Stephen23 2015 年 4 月 13 日
編集済み: Stephen23 2015 年 4 月 13 日
Indexed images also require the use of the map output of imread, which you will find explained in the documentation, along with complete working examples which I only slightly altered for you here:
>> [X,map] = imread('Afternoon Rain.bmp');
>> Y = ind2rgb(X,map);
>> image(Y)
which creates this figure:
You can check if the image is indexed by checking the map output: if it is empty then the image is not indexed. Alternatively you can use an external program to know if an image is indexed: for example this is the image information that GIMP shows, the fourth line clearly states that the colorspace of this image is indexed:
  1 件のコメント
Elysi Cochin
Elysi Cochin 2015 年 4 月 13 日
thank you so much...

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImages についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by