Define a RGBa color- transparency

조회 수: 95 (최근 30일)
Simon
Simon 2014년 7월 3일
답변: Image Analyst 2022년 11월 8일
Dear all,
is there a workaround to create, for example, a transparent yellow? Apparently Matlab colormap only works with RGB notations, not RGBa. My idea was: trans_yellow=[1 1 0 0.5] I want to define a transparent color, just changing the alpha value for the whole plot does not work for me.
Thanks!
  댓글 수: 1
deeksha rastogi
deeksha rastogi 2016년 12월 31일
이동: DGM 2022년 11월 8일
but what are the exact working of alpha matting and please write down its source code in matlab.

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

답변 (4개)

Rini Varghese
Rini Varghese 2016년 4월 5일
You can modify most object colors with 4 input arguments (RGBa notation) in MATLAB (2015). E.g. rectangle(x,y,w,h,'facecolor',[0 1 0,0.08]) will yield a transparent green box. Hope this helps!

Dhanyatha
Dhanyatha 2014년 7월 3일
편집: Dhanyatha 2014년 7월 3일
Currently, the colormap function does not accept more than 3 arguments. However,you can use the TIFF class in MATLAB to specify the alpha parameter for the image.
Refer to this link for an example on how to create a TIFF object with transparency.
To read RGBA image, you can use readRGBAImage(),readRGBATile() or readRGBAStrip() functions. These functions reads image data as RGB, with associated alpha parameter.

Image Analyst
Image Analyst 2014년 7월 3일
Perhaps - take a look at Steve's blog and see if it's what you want: http://blogs.mathworks.com/steve/2009/02/18/image-overlay-using-transparency/

Image Analyst
Image Analyst 2022년 11월 8일
You can now use labeloverlay to create transparent overlays.

카테고리

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