Chroma Keying


#1

Can anybody tell me where I can get information on Chroma Keying/Colour Replacement? I want to implement it myself in a project of mine but in order to do that I’m gonna need some theory on the subject (pdf whitepapers, etc.).

Thanks


#2

Chroma-keying is a relatively straightforward process, although most of the time in CG we do not actually use this technique unless we are dealing with “live video” input.

Chroma-key simply selects pixels of a certain color, specified within a very narrow (user-selectable) range of RGB values, and substitutes those pixels one-for-one with corresponding pixels from another input bitmap or frame.

The most common technique used in CG to achieve this compositing effect is to use the alpha channel, which is a fourth channel of information in addition to R, G, and B. This allows us to “mix” the values from the two channels: the closer the Alpha value is to (say) 0.0, the more transparent the layer is considered to be; so the more channel-2’s RGB values are mixed in. Likewise, values near (say) 1.0 indicate opaqueness: channel-1’s values take precedence. Values near 0.5 mix the two equally and so-on.

The essential advantage of alpha-information is that it has a range of values, whereas a chroma-key is either “there or not.” 1 or 0. Yes or no. With alpha and appropriate settings, a CG tool can generate “anti-aliasing” information to produce feathered edges, reducing the so-called “matte lines” that otherwise give-away a composited picture, and sometimes “twinkle” in video. (Many chroma-key (hardware) machines have anti-aliasing features which try to feather the edges, but they usually produce “blur lines” which are equally obvious.)


#3

I suppose I should have been more specific (I actually know all about alpha blending etc.). What I actually want to know is how, once you’ve selected your range of colours to remove, you actually go about removing them. If you just go and select all the pure blue from a scene you will end up with some hideously aliased edges around the pixels that must be left in tact. How do you remove the colour “beneath” the pixels at the edges? Is it some sort of extrapolation? Some sort of interpolation?


#4

Soudns like you are talking more about spill supression. I think you need to remove the colour you are trying to supress, whilst increasing the other two channels to keep the luminance up. I may be wrong though.

Simon


#5

I am sorry, Wahooney. I could not know your background and did not intend to insult it.

I would think that what you do is to remove the colors, probably by means of setting their alpha-values to zero, then go ahead and insert the new image and then anti-alias those boundaries in the composited result. Because, to get a good effect, you need to blend the adjacent colors as seen by the movie patron. Many of the still-image layering tools I’ve seen, and the blue-screen CG filters I’ve seen, implement anti-alias blending as a slider-controlled option.


#6

Are you looking for a way to remove the colored backing or to correct the discolored edges caused by spill?


#7

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.