Colormap and GIF images in Matlab -


i have problem understanding colormaps in matlab , using them import , diplay .gif images.

i import image using im = imread('i.gif') , display using imshow(im) result wrong

if [im,map] = imread('i.gif') , display using imshow(im,map) works properly, still don't understand need of colormap

is there way import , convert gif image greyscale when imshow(im) shows correct greyscale image without having worry colormap?

sorry noob question starting image processing in matlab , appreciate help. first question! :)

bye , thanks!

if want convert gif grayscale, use ind2gray:

[im,map] = imread('i.gif'); imgray = ind2gray(im,map); 

the reason need colormap gif format doesn't store image intensities, stores indices colormap. color 0 red or green or light shade of mauve. it's colormap stores actual rgb colors image needs. ind2gray take each of colors, convert them grayscale intensity, , replace indices in image intensities.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -