colormap from colormapeditor: increase bit depth?

조회 수: 3 (최근 30일)
Marco
Marco 2014년 4월 7일
편집: Marco 2014년 4월 7일
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...

답변 (1개)

Image Analyst
Image Analyst 2014년 4월 7일
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
Image Analyst
Image Analyst 2014년 4월 7일
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 2014년 4월 7일
편집: Marco 2014년 4월 7일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Purple에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by