displaying a 512 *512 8 bpp image
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I am having two lena image
- lena256.bmp---> a 256 *256 image
close all;
clear all;
clc;
%--------Displaying Lena image which has 256*256 size
imData=imread('lena256.bmp');
imshow(imData);
figure(1);
title('Original image');
pause(2);
By using above code I am able to display the image.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/149147/image.png)
2. lena_2.bmp----> 512 * 512 image
close all;
clear all;
clc;
%--------Displaying Lena image which has 256*256 size
imData=imread('lena_2.bmp');
imshow(imData);
figure(1);
title('Original image');
pause(2);
by using the above code, the image displaying is as follow
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/149148/image.png)
why is it so?? why second image is not correct
0 comentarios
Respuestas (1)
DGM
el 13 de Nov. de 2022
The image is an indexed image. You need the corresponding color map in order to do anything with it.
[A map] = imread('lena.bmp'); % read the image and the map
imshow(A,map); % use the map to display or write the image
In this case, the copy of lena.bmp appears to be a color image with a relatively short color table and no dithering. Be aware that there are many versions of this image floating around. Some are I/RGB; some are indexed grayscale or color with varying map lengths and dithering methods. Just because you have a file called 'lena.bmp' doesn't mean it's the same as something you see described in a code example on a forum somewhere.
0 comentarios
Ver también
Categorías
Más información sobre Image Data 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!