In the digital method of compositing, software commands designate a narrowly defined color as the part of an image to be replaced.
In television studios, blue or green screens may back news-readers to allow the compositing of stories behind them, before being switched to full-screen display.
In other cases, presenters may be completely within compositing backgrounds that are replaced with entire "virtual sets" executed in computer graphics programs.
Virtual sets are also used in motion picture filmmaking, usually photographed in blue or green screen environments (other colors are possible but less common), as for example in Sky Captain and the World of Tomorrow.
"Sets" of almost unlimited size can be created digitally because compositing software can take the blue or green color at the edges of a backing screen and extend it to fill the rest of the frame outside it.
In the film Gladiator, for example, the arena and first tier seats of the Roman Colosseum were actually built, while the upper galleries (complete with moving spectators) were computer graphics, composited onto the image above the physical set.
For motion pictures originally recorded on film, high-quality video conversions called "digital intermediates" enable compositing and other operations of computerized post production.
In physical compositing the separate parts of the image are placed together in the photographic frame and recorded in a single exposure.
The plantation and fields are all painted, while the road and the moving figures on it are photographed through the glass area left clear.
A variant uses the opposite technique: most of the area is clear, except for individual elements (photo cutouts or paintings) affixed to the glass.
In the studio, the resulting "background plate" is loaded into a projector with the film "flipped" (reversed), because it will be projected onto (and through) the back of a translucent screen.
Color filming presents additional difficulties, but can be quite convincing, as in several shots in the famous crop duster sequence in Alfred Hitchcock's North by Northwest.
Because of its complexity, rear projection has been largely replaced by digital compositing with, for example, the car positioned in front of a blue or green screen.
Each masking is performed by a "traveling matte": a specially altered duplicate shot which lies on top of the copy film stock.
First, a print from the original negative is made on high-contrast film, which records the backing as opaque and the foreground subject as clear.
Then the process is repeated; but this time, the copy film is masked by the reverse matte, which excludes light from the foreground area already exposed.
With pre-digital matting, the several extra passes through the optical printer would degrade the film quality and increase the probability of edge artifacts.