PDA

View Full Version : layer colordependent transparancy


Wilbert
26th August 2002, 16:16
Suppose I got two clips, a background clip and an overlay clip, and I want to define a new clip overlay(clip_back,clip_over,stuff). I would like to see all the colored (that is anything except the black areas of clip_back) stuff from clip_back and from clip_over in the resulting clip. (So I don't want to see _anything_ of the black of clip_back in the resulting clip.) Is something like this possible?

WarpEnterprises
26th August 2002, 23:06
If I got you I describe it:

If a pixel of clip_back is BLACK then show clip_overlay else show clip_back

(the roles of back and over are exchanged in Layer()...)

BACK=Mask(BACK, BACK.greyscale.levels(0, 1, 1, 0, 255)) #only black is transparent else is opaque, maybe you have to change 0,1,1 to 16,1,17 when coming from yuy2

Layer(OVER, BACK, "add", 255, 0,0,0) #layer BACK on top of OVER maximal 100%(=255) where mask is transparent.

Wilbert
27th August 2002, 14:08
If a pixel of clip_back is BLACK then show clip_overlay else show clip_back

Yes, that's what I had in mind. I will try it when I am home. But what I actually what is the following:

If a pixel of clip_overlay is BLACK then show clip_back else show clip_overlay. Is that also possible with those masks?

ps, I sent you an email.

edit: I already figured it out yesterday when trying your script, thanks anyway.