Flash 8: Realtime Video Color Keying
My previous experiment with the selective color transforms made me think a bit more about creating masks from colors and its applications. I wondered if it is possible to use a similiar technique to calculate green screen or blue screen masks in realtime for Flash video. And indeed - it works.
I’ve programmed a keying technique similar the Color Difference Key known from AfterEffects or other video editing programs. This kind of keying allows for finer control and better transitions than for example a simple chroma key.
A very important factor for successful keying is good lighting of the fore- and background and as I don’t have a studio at hand for this demo I allowed myself to use the example clip from this Macromedia Video Tutorial featuring Tom Green - I hope that’s okay for this purpose. I’ve converted the original 20MB quicktime movie to a 1 MB FLV (wow, isn’t that on2 codec great?) - and there is definitely no more alpha channel in there. Alternatively you can try to use your webcam, but if you don’t have good lighting and a decent background the results will be only so-so. But I can imagine that the same technique could be used for example on still images to mount peoples’ heads on avatars.
Here is the demo:




