"Pixel Color"

조회 수: 14 (최근 30일)
romain dalidet
romain dalidet 2017년 6월 29일
댓글: romain dalidet 2017년 6월 29일
Hello everyone, basically I have a series of images like this one :
Which is an imagesc of a 256x256 matrix. Every values of the matrix that are "inside" the hexagon are greater than 0 while other values equal 0. What I would like to do is get every pixel coresponding to 0 to be white, not blue. I could use "paint" but I have a thousand of images that looks like this one ... I've tried to modify the colormap using colormapeditor but the value difference between blue pixels inside the hexagon and yellow pixels is more 10^6, which gives me a result like this :
Any advice would be good, thanks in advance !

채택된 답변

Adam
Adam 2017년 6월 29일
data = magic(30);
figure; h = imagesc( data );
h.AlphaData = data > 100;
You can do the same in your case, just keep the image handle and create a mask for the alpha data. This assumes your underlying axes are white though because it makes the data transparent, not white, but if your axes are white then it looks white.
  댓글 수: 1
romain dalidet
romain dalidet 2017년 6월 29일
It is working great, thank you ! (I made the line more wide so we don't see the pixelisation)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Color and Styling에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by