colormap of a rgb image

7 views (last 30 days)
Anshul garg
Anshul garg on 23 Jun 2012
can anyone help with getting colormap of a image?

Accepted Answer

Walter Roberson
Walter Roberson on 23 Jun 2012
The colormap of an RGB image is, by convention, [] (the empty array)
If you need to convert an RGB image to a pseudocolor image, use the two-output version of rgb2ind()
  2 Comments
Anshul garg
Anshul garg on 24 Jun 2012
i agree with you but if i want to change the gray image to same rgb image(after using rgb2gray())then i would need colormap .so where would i bring that from?
Image Analyst
Image Analyst on 24 Jun 2012
You can't do that. With rgb2gray, there are many colors that would give the same gray level. you'd need to do this with rgb2ind which gives you the colormap. But then if you displayed that with a gray colormap, it would look bizarre so you'd have to keep both the rgb2gray image hanging around as well as the rgb2ind image hanging around. I say why even bother with all that when you still have the original rgb image that you used to convert into gray or indexed?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!