How can I set a variable alpha channel to an image?

조회 수: 6 (최근 30일)
emand
emand 2017년 6월 22일
답변: Image Analyst 2017년 6월 22일
I display the mean of a 2-D distribution with imagesc(mean(whatever)), and I wish to make it transparent where the distribution std reach a maximum and opaque where std is at its minimum.
Alpha channel allows me to make the whole image more or less transparent, how can I apply a variable alpha channel?

채택된 답변

Adam
Adam 2017년 6월 22일
You can use a mask image of the same size as your main image, filled with 0-1 values to give any level of transparency on a per-pixel basis.
So you can apply a mask to your data e.g.
myMask = data > 0.5;
and then use this as an alpha value which would make values greater than 0.5 opaque and those less transparent, but you are not limited to 0 and 1 in the alpha channel.

추가 답변 (1개)

Image Analyst
Image Analyst 2017년 6월 22일

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by