Log in

View Full Version : How to mask out background and overlap clips with transparency?


r6d2
23rd December 2003, 16:27
Hi there,

You know those filmmakers which superimpose two clips, one of them as background and the other one shot with something called "blue screen" or "green screen"?

I looked into the forum for "blues screen" but only got references to Windows errors, and "green screen" refered to colorspace problems. ;)

I have this clip, an MPEG-2 movie, and I want to superimpose a home movie on top of it (in this case, my kid). I think that if I shoot the movie of my kid him standing over a green or blue background, I can detect that and filter it to be transparent, then just add the two clips and get a reasonable image.

Would this work?

Does anyone have a clue on how to do this? Which filters to use? Any pointers?

Thanks a lot in advance.

mf
23rd December 2003, 16:51
AVISynth has ColorKeyMask that only works in RGB, and MaskTools has OverlayMask which works in YV12. OverlayMask may be a bit cryptic in its usage so I suggest you start experimenting with ColorKeyMask which is alot more straightforward.

albertgasset
23rd December 2003, 20:36
Hi,

I've written a plugin that can do exactly what you need.
It can also be done with Avisynth functions, but wwith this filter I think it's easier and it's faster.
This is the first filter I write, it works in YUY2 and RGB32 colorspaces and the code is optimized in assembly for MMX.

Blend-1.0.zip (http://www.fib.upc.es/~e7716401/Blend-1.0.zip)

My first liitle contribution, I hope it can be useful.


Albert Gasset

r6d2
24th December 2003, 01:45
@mf, thanks for the pointers. I'll dig into them.

@albertgasset,

I just cannot believe there is already a tool for this! Thanks a lot! And it looks it's brand new too! (dated dec.22)

I tried the sample and works great!

I yet have to find out how to use it, so if I have any questions, I hope you'll be around. ;)
:thanks: