Why does my bitmap image appear incorrectly when I display it using IMSHOW in Image Processing Toolbox 6.1 (R2008a)?

2 views (last 30 days)
I am reading in an image file using IMREAD, and then displaying it using IMSHOW. However, it appears very grainy. For example, if I have a file test.bmp:
imagedata = imread('test.bmp');
imshow(imagedata);
Why is my image displayed incorrectly?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
Some bitmap files have an associated color map with them. Both the image data as well as the color map data must be read in and passed into IMSHOW. The image should display correctly if the following code is used to read and display the image:
[imagedata imagemap] = imread('test.bmp');
imshow(imagedata, imagemap);

More Answers (0)

Products


Release

R2008a

Community Treasure Hunt

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

Start Hunting!