Katana VentraIP

Chroma key

Chroma key compositing, or chroma keying, is a visual-effects and post-production technique for compositing (layering) two or more images or video streams together based on colour hues (chroma range). The technique has been used in many fields to remove a background from the subject of a photo or video – particularly the newscasting, motion picture, and video game industries. A colour range in the foreground footage is made transparent, allowing separately filmed background footage or a static image to be inserted into the scene. The chroma keying technique is commonly used in video production and post-production. This technique is also referred to as colour keying, colour-separation overlay (CSO; primarily by the BBC[3]), or by various terms for specific colour-related variants such as green screen or blue screen; chroma keying can be done with backgrounds of any colour that are uniform and distinct, but green and blue backgrounds are more commonly used because they differ most distinctly in hue from any human skin colour. No part of the subject being filmed or photographed may duplicate the colour used as the backing, or the part may be erroneously identified as part of the backing.[4]

"Green screen" redirects here. For other uses, see Green screen (disambiguation).

It is commonly used for live weather forecast broadcasts in which a news presenter is seen standing in front of a large CGI map which is really a large blue or green background. Using a blue screen, different weather maps are added on the parts of the image in which the colour is blue. If the news presenter wears blue clothes, their clothes will also be replaced with the background video. Chroma keying is also common in the entertainment industry for visual effects in movies and video games. Rotoscopy may instead be carried out on subjects that are not in front of a green (or blue) screen. Motion tracking can also be used in conjunction with chroma keying, such as to move the background as the subject moves.

History[edit]

Predecessors[edit]

Prior to the introduction of travelling mattes and optical printing, double exposure was used to introduce elements into a scene which were not present in the initial exposure. This was done using black draping where a green screen would be used today. George Albert Smith first used this approach in 1898. In 1903, The Great Train Robbery by Edwin S. Porter used double exposure to add background scenes to windows which were black when filmed on set, using a garbage matte to expose only the window areas.[5]

Programming[edit]

There are several different quality- and speed-optimised techniques for implementing colour keying in software.[21][22]


In most versions, a function f(r, g, b) → α is applied to every pixel in the image. α (alpha) has a meaning similar to that in alpha compositing techniques. α ≤ 0 means the pixel is fully in the green screen, α ≥ 1 means the pixel is fully in the foreground object, and intermediate values indicate the pixel is partially covered by the foreground object (or it is transparent). A further function g(rgb) → (rgb) is needed to remove green spill on the foreground objects.


A very simple f() function for green screen is A(r+b) − Bg where A and B are user adjustable constants with a default value of 1.0. A very simple g() is (r, min(g,b), b). This is fairly close to the capabilities of analog and film-based screen pulling.


Modern examples[22] of these functions are best described by two closed nested surfaces in 3D RGB space, often quite complex. Colours inside the inner surface are considered green screen. Colours outside the outer surface are opaque foreground. Colours between the surfaces are partially covered, they are more opaque the closer they are to the outer surface. Sometimes more closed surfaces are used to determine how to remove green spill. It is also very common for f() to depend on more than just the current pixel's colour, it may also use the (xy) position, the values of nearby pixels, the value from reference images or a statistical colour model of the scene,[23] and values from user-drawn masks. These produce closed surfaces in space with more than three dimensions.


A different class of algorithm tries to figure out a 2D path that separates the foreground from the background. This path can be the output, or the image can be drawn by filling the path with α = 1 as a final step. An example of such an algorithm is the use of active contour. Most research in recent years has been into these algorithms.

How Blue Screens Work

Stargate Studios Virtual Backlot Reel 2009 – A demonstration of green screen scenes

ChromaKey SourceCode