MATLAB: Read and display RGB png/jpg image

image

Hi,
I need help in reading and displaying RGB png and jpg image. I am using the follwoing code, but imshow is displaying grayscale image only.
original = imread('C:\Users\R\Desktop\Image\image1.png');
original = im2double(original);
imshow(original)
title('Original image')

Best Answer

You png file is actually an indexed image with a colormap. You can see it in color using following statements
[img, map] = imread('image.png');
imshow(img, map)
or, you convert it to rgb, you can use ind2rgb()
[img, map] = imread('image.png');
img_rgb = ind2rgb(img, map);
imshow(img_rgb)