Change Fractal Colors to nuances of red

조회 수: 7 (최근 30일)
Silvia Bernardi
Silvia Bernardi 2019년 8월 16일
댓글: Adam Danz 2019년 8월 19일
Hello,
I have a series of fractals in RGB, such as the one uploaded here, and I would like to change their colors to only nuances of red, black and white. So that the structure of the image would remain in white or black and the filling will be only red. image0006v1.bmpAny suggestions would be welcome.
  댓글 수: 2
Walter Roberson
Walter Roberson 2019년 8월 16일
Possibly rgb2ind() followed by using a different colormap() with ind2rgb()

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

채택된 답변

Subhadeep Koley
Subhadeep Koley 2019년 8월 19일
Building a custom colormap might solve your issue. Similar question can be found here.
Tweaking the "hex" vector as shown below could help solve the issue.
a=imread('image0006v1.bmp');
%modify the sample points inside vec and put the hex code for as many different shades of red you want
vec = [ 100; 83; 68; 44; 30; 15; 0];
hex = ['#FF6347';'#DC143C';'#FF0000';'#B22222';'#B22222';'#8B0000';'#800000'];
raw = sscanf(hex','#%2x%2x%2x',[3,size(hex,1)]).' / 255;
%N =100;
N = size(get(gcf,'colormap'),1) % size of the current colormap
map = interp1(vec,raw,linspace(100,0,N),'spline');
rgbImage = ind2rgb(a, map);
imshow(rgbImage);
  댓글 수: 1
Adam Danz
Adam Danz 2019년 8월 19일
The RGB vectors may be easier to work with. For example, here's a colormap that fades from black to red.
colorMap = [linspace(0,1,256)', zeros(256,2)]
colormap(colorMap);

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by