Displaying gif Image in Matlab

I have a .gif image in my directory. When I open it there is a variable 'cdata' with the pixel data and a variable 'colormap' with the colour map.
I want to display the image, but when I type
image(cdata)
The colours are wrong. I tried setting the colormap using
colormap('colormap')
But this still didn't work.

Respuestas (2)

Leah
Leah el 24 de Jun. de 2013

2 votos

[I cmap] = imread('image_name.gif','frames','all');
image(I);
colormap(cmap);
Nitin
Nitin el 24 de Jun. de 2013

1 voto

I = imread('image_name.gif');
imshow(I)

1 comentario

Robert
Robert el 24 de Jun. de 2013
When I do this the displayed image is black and white. I can see the correct image in the Matlab preview of the photo, so it must be something to do with the colormap.

Iniciar sesión para comentar.

Categorías

Más información sobre Color and Styling en Centro de ayuda y File Exchange.

Preguntada:

el 24 de Jun. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by