rgb2ind and colormap

Bertrand Roessli bertrand.roessli at psi.ch
Wed May 6 03:04:55 CDT 2009


Hello,

if I use this code 

[I]=imread('im.jpg');
[data,map]=rgb2ind(I);
imshow(data,map);

(octave 3.1.55) 

I get an error message as the values in the 
colormap are not scaled between automatically between [0:1], 
but range from [0:255].  

I am not sure this is expected. Should the values in 
the colormap not be divided by 256 per default?

Anyway, if I divide the values by 256 (?) I cannot get 
back the original picture. 

Thank you,

Bertrand Roessli 





More information about the Help-octave mailing list