[img map] = imread('mypic.gif');
if ~isempty(map), img = ind2rgb(img, map); end
imshow(img);
% imwrite(img, 'mypic.jpg');
% imwrite(img, 'mypic.bmp');
if ~isempty(map), img = ind2rgb(img, map); end
imshow(img);
% imwrite(img, 'mypic.jpg');
% imwrite(img, 'mypic.bmp');