colormap from colormapeditor: increase bit depth?

How to increase the bit depth in a colormap created with the colormapeditor from the by default generated 64 color steps to wished 128 steps, or even 256 steps? The present transitions between colors shall be interpolated so that they for the human eye look the same as before, just no more so coarse stepped, but finer stepped! My so far interactively edited colormap is saved to a 64x3 variable "myname", available in a *.mat file, and I would highly appreciate a solution which does not ask me to interactively edit it again - it was quite some work to get it to what it at least so far looks like...

Réponses (1)

You need to use a colormap with more than 64 colors before you call colormap editor because that initializes to using the current colormap. Try this:
% Display a standard demo image.
imshow('cameraman.tif');
% Make a colormap with the full 256 colors.
colorMap = jet(256);
% Apply the colormap to the displayed image.
colormap(colorMap);
% Put a colorbar scale next to the image.
colorbar;
% Bring up the editor utility.
colormapeditor

5 commentaires

Marco
Marco le 7 Avr 2014
Thanks, although its not solving my problem, becasue it actually means to start creating my colormap from the beginning. But that's just what I try to prevent. Not your fault, that I am extremely angry to not have found before that important information given by you in the doc, when starting out to create my colormap. OK, I'll wait, maybe someone else comes in with an idea how to proceed on from my current state described above, otherwise all graphs enter the publication ugly as they are rigth now. Anyway, to you Image Analyst, THANKS!!! I with your help at least next time can proceed more efficient.
I'm not sure what you have. Why can't you just set a colormap with enough entries before you display the image? DO you have some pseudocolored image that has already been converted to an RGB image or something?
Marco
Marco le 7 Avr 2014
Modifié(e) : Marco le 7 Avr 2014
I started in the colormapeditor with the copper colormap, thus 64 color, and edited it to have a "variation" of it with i.e. the max color white, the highest colors almost yellow, in the middle going down from wooden brown to darkish copper red to finally black. Like this it is a kind of jet alike copper colorbar very good for pronouncing to the eye changes in a height profile. While the original copper colormap does not resolve for the eye sufficiently different height levels, the jet appears with too much colors. So I stretched or pronounced certain areas in the copper colormap until it kind of perfectly shows to the eye what's important in the height profile without running too far (i.e. I use no blue or green) away from the base copper color. Just that it is now still 64 colors only, and I didn't find how to render it finer. The thing is, my colormap is so to say ready, which took me - interactively - many hours, and I would prefer to just find how to interpolate to 256 steps now, instead of staying with 64 steps only. Starting from scratch is not what my nerves would stand.
If you can get it into an array of numbers, you can use interpolate or spline to smooth it out. I've attached a spline demo for you.
Marco
Marco le 7 Avr 2014
Modifié(e) : Marco le 7 Avr 2014
OK, thanks! I'll report back how it worked out. I'll need some time / days. I am still new to MATLAB, and programming in general, and everything still goes slow...
Spending my time studying your demo, the spline and interpolate function I will at least learn something new instead of only boringly repeat an interactive design session.
I'll be back.

Connectez-vous pour commenter.

Question posée :

le 7 Avr 2014

Modifié(e) :

le 7 Avr 2014

Community Treasure Hunt

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

Start Hunting!

Translated by