Define a RGBa color- transparency

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 Kommentar

deeksha rastogi
deeksha rastogi am 31 Dez. 2016
Verschoben: DGM am 8 Nov. 2022
but what are the exact working of alpha matting and please write down its source code in matlab.

Melden Sie sich an, um zu kommentieren.

Antworten (4)

Rini Varghese
Rini Varghese am 5 Apr. 2016

1 Stimme

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 am 3 Jul. 2014
Bearbeitet: Dhanyatha am 3 Jul. 2014

0 Stimmen

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 am 8 Nov. 2022

0 Stimmen

You can now use labeloverlay to create transparent overlays.

Gefragt:

am 3 Jul. 2014

Beantwortet:

am 8 Nov. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by