Green Screen Video
Operator: Abdulla Al Fahad. How tools are built and checked
A green bedsheet pinned behind a presenter is never one green: the folds in shadow are much darker than the parts the lamp hits, and a keyer that judges brightness along with colour either leaves the shadowed folds in the picture as a murky patch or starts eating into the subject. This page keys on colour alone. It measures how far a pixel's hue and saturation are from the key colour and ignores how light or dark it is, so the shadowed fold and the lit sheet both count as backdrop while skin, which sits far from green, stays. The worked example below puts numbers on that.
Key features
- Key colour from a hex code, the chroma green and blue presets, a click on a frozen frame, or one press on the four corners
- Tolerance, edge softness and spill removal sliders, with a matte view where white is kept and black is removed
- A colour, a picture or a looping video behind the footage, and the footage's own sound kept or dropped
- A readout of how much of the frame is removed, and a transparent PNG of the current frame at up to 2048 pixels
How the key colour is measured and why the video has no alpha
The page takes a video of up to 10 minutes that the browser can play, and writes MP4 or WebM at the original size or capped at 1080p, 720p or 480p on the shorter side. The result has no transparency: MP4 and WebM recorded in the browser carry no alpha channel, so the background is always burned in. The matte view and the PNG frame, which does keep its alpha, are for tuning and for stills. Keying runs for every frame while the video plays in real time, so a slow computer may record fewer frames per second than the source, but the video keeps its length.
How it works
Each pixel's colour is reduced to its blue and red colour-difference values (Cb and Cr of BT.601), which carry hue and saturation without brightness, and the distance to the key colour's pair is measured. Tolerance 30 means a distance up to 36 units is fully removed, because the slider is scaled by 1.2; distances run from 0 for the same colour to about 255 for opposites such as blue and yellow.
Beyond the tolerance the alpha rises along a smoothstep over the softness distance. With tolerance 30 and softness 20 the ramp runs from 36 to 60 units, so a pixel at 47.6 units is 47% opaque and one at 60 or more is fully opaque.
Spill removal acts on pixels that stay visible. It takes the key colour's strongest channel, green for a green screen, and pulls it back towards the average of the other two by the percentage you set. The corner button averages a block in each corner and uses the one nearest the median of the four, so a light stand in one corner does not set the key.
Common use cases
- A 3-minute product explainer shot at 1280 by 720 renders in at least 3 minutes, and the footage's own voice is kept as it is.
- A 3840 by 2160 phone recording capped at 720p is keyed at 1280 by 720, which is a ninth of the pixels to key in every frame.
How to use this tool
- Open the footage and check that the first frame shows the backdrop in all four corners.
- Press Sample the four corners, or Grab this frame and click the backdrop.
- Switch on Show the matte and raise Tolerance until the backdrop is solid black.
- Raise Edge softness until the outline of hair and shoulders is smooth but not ghosted.
- Raise Spill removal until the green is gone from the edges of skin and clothes.
- Choose a colour, picture or video for the background and look at the preview.
- Pick the size and file type and press Render video.
Example
Pixels sampled from a frame shot against a green sheet; key (0, 177, 64), tolerance 30, softness 20, spill 50%
Shadowed backdrop (0, 106, 38)
Lit backdrop (30, 210, 90)
Skin (224, 172, 150)
White shirt (240, 240, 240)
Hair edge (90, 165, 100)Distance, then what the page does
Shadowed backdrop: 33.5, removed
Lit backdrop: 3.1, removed
Skin: 107.3, kept
White shirt: 83.7, kept
Hair edge: 47.6, 47% opaque, and its green drops from 165 to 130, giving (90, 130, 100)Common pitfalls
Anything near the key colour is removed, including a green shirt, a plant or green reflections in glasses; the subject has to be dressed away from the backdrop colour.
Spill removal changes every visible pixel that leans towards the key, so a green logo or a leaf in the scene is greyed too. Lower the spill percentage if that happens.
Phone video stores colour at half resolution, so edges can look blocky or shimmer in motion even with a clean key. A little softness hides it.
A background picture is scaled to cover the frame. A small picture enlarged to 1920 pixels wide looks soft, so use one at least as large as the output.
- Sample the corners first, then adjust. A studio backdrop is usually even at the edges of the frame, and the sample gives you a starting colour to adjust from.
- Save a frame as PNG and open it over a checkerboard in an image viewer to look at the hair edge at full size before spending minutes on a render.
Common errors and how to fix them
- The video is longer than 10 minutes
- Trim it first. The key is computed while the footage plays, which is why the limit is there.
- Render video stays greyed out
- The video is over 10 minutes, the key colour is not a valid hex code such as #00b140, the chosen background picture or clip has not finished loading, or the browser cannot record a canvas.
- A background picture is over 25 MB or 50 megapixels
- Resize it first; any size up to those limits is accepted.
Best practices
- Tune on a frame where the subject is moving, not a still one, so the matte shows how the edge behaves in motion.
- Use the smallest tolerance that makes the backdrop solid black in the matte; every extra unit starts eating the subject's own colours.
- Check the preview at a frame with the darkest fold of the backdrop, since that is the one that fails first.
Why the output has no transparency
Browsers record the keyed canvas through MediaRecorder, and the MP4 and WebM it writes have no alpha channel. The page therefore composes the new background itself and records the finished picture, which is what most uses want. If you need real alpha for an editor, this page cannot write it as video; the PNG button saves single frames with their transparency.
What tolerance and softness trade
Tolerance decides how much of the backdrop disappears; softness decides how gradually the outline appears. A low tolerance with high softness leaves a haze of green across the backdrop, and a high tolerance with no softness leaves a hard, jagged outline. The matte shows both: haze shows as grey, jaggedness as stair-steps along hair.
Frequently asked questions
Can I key out a colour other than green or blue?
Yes. Any colour can be the key; spill removal then limits whichever channel is strongest in it. Skin tones are close to red and orange, so keying those out would take the subject with it.
Why does rendering take as long as the video?
Each frame is keyed while the footage plays and recorded as it is drawn, so a 4-minute clip takes at least 4 minutes, and a hidden tab pauses the recording.
Can I use this on still photos?
No, it works on video. Remove White Background and AI Background Remover on this site cut the subject out of a photo.