Log in

View Full Version : Can AviSynth make a chroma key?


3D cinema
24th September 2010, 12:57
Hi!

Dear friends, I am delighted with possibilities that AviSynth gives for digital filmmaking.

Can AviSynth make a chroma key? What I mean under the term? – It is something like overlaying but without green (or blue) color in a top clip. Instead the green we shall see a background clip. Is it possible any script for the chroma key technology?

ajp_anton
24th September 2010, 13:59
Until someone gives a more details answer, you can start experimenting with mt_masktools (MaskTools v2). Something like, "if pixel = [green], mask=255, otherwise mask=0".

Motenai Yoda
24th September 2010, 15:09
there is a "ColorKeyMask" function to make the mask
http://avisynth.org/mediawiki/Layer#ColorKeyMask

3D cinema
4th October 2010, 13:07
Hi everybody!

Thank you for the advices. It works!

I have written a script for chroma key technology:
clip1 = AviSource("D:\My reels\videoreel_1.avi")
clip2 = AviSource("D:\My reels\videoreel_Green.avi")# clip2 must be RGB32
maskclip = ColorKeyMask(clip2, $125d12, 40)
# Second argument is RGB into hexadecimal numbers. Third argument is a tolerance.
Overlay(clip1, clip2, mask=ShowAlpha(maskclip), mode="blend", opacity=1)