MATLAB Answers

conver bmp image to color image

14 views (last 30 days)
fereshte
fereshte on 28 Jun 2014
Commented: fereshte on 28 Jun 2014
hi.i have a color image and use the crop function to select part of it.but Output image isnt color.why? how get a color image after cropping?
im=imread('5 2R.bmp');
croppedImage = imcrop(im,[0.5 80.5 45 38]);
imshow(croppedImage);

  0 Comments

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 28 Jun 2014
Is im an indexed image? What does this say
[im, colorMap] = imread('5 2R.bmp');
whos colorMap
[rows, columns, numberOfColorChannels] = size(im)

  3 Comments

fereshte
fereshte on 28 Jun 2014
im is a original bmp image and i extraced part of this image by imcrop.but i want a color image in output.how do it?
Image Analyst
Image Analyst on 28 Jun 2014
Please take my suggestion so I can diagnose your problem. What does the command window say when you run the commands I asked you to run? In the meantime, try
rgbImage = ind2rgb(im, colorMap);
fereshte
fereshte on 28 Jun 2014
thanks a lot.great

Sign in to comment.

More Answers (0)

Sign in to answer this question.