The goal of a chromakey is to create an opacity matte (or alpha channel) that isolates a subject being filmed from their background so that they may be composited in front of a different background.
This happens both in realtime applications and in offline composites for rendering.
Realtime chromakeys are used for weather people to appear in front of their maps on the local news. They're used in Zoom conferences to make a participant appear in front of a Tahitian beach, or in OBS streams to composite a gamer's head over their Mario speed run.
Offline chromakeying is done in compositing and video editing software such as Nuke, After Effects, Premiere, DaVinci Resolve, and iMovie for compositing over film plates, video background, and stills in everything from VFX feature films to indie music videos to home movies.
Traditional Greenscreen Example
By filming in front of a saturated bright green or blue background, software can identify areas of the image that contain the subject (the non-green or non-blue pixels) such as actors, props, and puppets, and create a "hold out matte" for them.
In the image seen here, the matte has is an opacity map in which black pixels are transparent and white pixels are opaque, with gray shades in between for partial opacity.
This matte is then used to composite only the foreground image over a different background layer.
The entire premise of shooting on a greenscreen relies on having a very evenly lit greenscreen. The more variation in the lighting from shadows cast on it by the subject, the more difficult it is to use.
Additionally, it's important to avoid having green spill light bounce from the greenscreen onto the actors.
These issues are typically solved by creating a lot of space between the actors and the greenscreen, by lighting the greenscreen with dedicated lights, and by avoiding frontal lighting for the actors to prevent shadow casting.
These techniques work well in a dedicated filming environment such as a soundstage, but can be a huge challenge when shooting at home or in other constrained locations.
In this image, our living room has been turned into a greenscreen stage. Note the pair of side lighting rigs dedicated to the greenscreen.
Since the requirement of a greenscreen is to have an evenly lit, saturated color backdrop, there must be a way to achieve this that doesn't require a lot of space and dedicated lighting, right? There is! Enter the retroreflector!
A retroreflector is a specialized material (or arrangement of mirrors) that reflects light directly back at its source, regardless of incoming angle. This is why you see a runners shoes, or a safety vest, or a stop sign at night so brightly reflect the light from your car's headlights the entire time they're in view -- there isn't just one flash of light if you get lucky and the angles align for a brief moment. The retroreflective material ensures that.
Here's a terrific video on retroreflectors that my friend Josh shared with me.
Retroreflective fabric is covered in tiny spherical lenses which direct incoming most light back at its source, regardless of entrance angle. They do this by refracting incoming light beams toward a mirrored surface below the lens, which reflects the light, and then the glass beads refract the light a second time, aiming them back toward the same direction from which they came.
This image adapted from one on the 3M Scotchlite website may help explain:
Here's a demonstration of the retroreflector in action. With a flashlight positioned directly inline with the camera lens, we can see how the light returns back toward the lens no matter what angle the light is relative to the retroreflective backdrop.
If we shine an even, saturated green (or blue) light at the retroreflector from the point of view of a camera, all of that lovely green light gets reflected right back at the camera lens. The light does not need to be very bright at all, which means a ring of LEDs will do the trick of turning the backdrop into an even chroma screen but will not cast any colored light onto the actors. It's science, but the results seem magical!
Also, note how the subject in the following examples is just inches from the screen without any problems from shadows that we'd see with a traditional greenscreen.