Green Screen Remover on Noisy Footage: Why Grain Becomes Alpha Speckle

Grain is not a colour cast and not a soft edge. It is a per-pixel random vector that moves the backdrop in and out of the tolerance ball, so a few thousand isolated pixels key as opaque salt. The fix is a measured tolerance floor and a denoiser that removes outliers without smearing the silhouette.

Short answer: noise does not tint a matte; it pushes single backdrop pixels past the tolerance line, where they survive as specks. On a σ16 test frame the hair-friendly 12%/8% key left 2,023 backdrop pixels above alpha 8 (1,998 separate specks, 36 visible); the default 22%/3% left none. Measure the backdrop's 99.99th-percentile distance and set tolerance above it.

Measured 2026-11-17 on a synthetic 800×600 frame with the exact colour-distance formula used by this site's keyer. Script: gsr-loop/scripts/noise-key-20261117.js; raw result: noise-key-20261117.json.

What noise does to a key, exactly

The key asks one question per pixel: how far is this colour from the sampled green? Distance is Euclidean in sRGB, divided by 441.6729559, so it is a number between 0% (the key itself) and 100% (the farthest corner of the colour cube). Everything below the tolerance is alpha 0; everything above tolerance plus softness is alpha 255; the thin band between is the ramp.

Noise adds an independent random value to each channel before that distance is computed. On a flat backdrop the true distance is 0%, but a noisy pixel can sit at 6%, 12% or 20%. A pixel at 21% is invisible at a 22% tolerance and a visible hole at 19%. Because the noise is independent per pixel and the key has no spatial term, these failures do not blend into a haze: they appear as isolated one- and two-pixel specks, which is exactly what makes them look like dust or salt rather than a green cast.

The ceiling is set by the nearest real material. In this frame the measured distances are: green scarf 15.87%, hair 35.51%, skin 51.00%, white shirt 65.60%. At σ16 the backdrop's 99.99th percentile is 16.08%, so a tolerance with 3 points of softness headroom has to start at 19.08%. That is already above the scarf. There is no setting that clears the noisy backdrop and keeps a near-key garment solid — not because the slider is badly designed, but because both colours occupy the same distance range.

Colour distance of the flat materials in the test frame, using sqrt(dr²+dg²+db²)/441.6729559 from #00b140.
MaterialColourDistanceAlpha at 22% / 3%Alpha at 12% / 8%
Green scarf#2f7d3f15.87%0123
Hair#1b1b1b35.51%255255
Skin#d9a07a51.00%255255
White shirt#e6ece665.60%255255

Measured: seven noise levels, two settings

The frame is 800×600 with 328,802 backdrop pixels, 1,346 edge pixels and 149,852 solid subject pixels. Shapes are rendered with 4×4 supersampling, so the true coverage of every edge pixel is known; Gaussian noise is then added to the composited RGB, the way sensor noise appears after the optical mix. The two settings are the site's default 22%/3% and the hair-friendly 12%/8% measured on the hair-flicker page.

Noise sweep on one frame. “Floor” is the 99.99th-percentile backdrop distance plus 3 points of softness headroom. Speck counts are backdrop pixels with alpha > 8; “visible” is the subset at alpha ≥ 128. Edge Δ is the change in mean alpha error against the same setting at σ0, so positive means worse.
σ (levels)p99.99 distanceFloor12/8 speck px12/8 visible12/8 edge Δ22/3 speck px22/3 visible22/3 edge Δ
00.00%3.00%000.0000.0
44.04%7.04%00−0.600−1.3
88.16%11.16%00−0.300−1.6
1212.21%15.21%290+1.800−0.6
1616.08%19.08%2,02336+3.000−0.6
2423.76%26.76%39,9437,333+7.414038+3.4
3230.83%33.83%106,96541,545+12.54,1002,224+7.3

Three things are worth reading off that table. First, the failure arrives suddenly. At σ8 both settings are clean; at σ12 the 12%/8% key already has 29 speck pixels; at σ16 it has 2,023 pixels in 1,998 separate specks, the largest only 2 px. Second, the default 22%/3% is genuinely noise-tolerant: it holds until σ16 and only starts at σ24, with 140 pixels. Third, the setting that saves thin hair is the one that breaks first, because 12% is a much smaller ball. On this frame, 12% stops covering 99.99% of the backdrop at about σ11.8; 22% at about σ22.1; 28% at about σ28.8. Those crossings are interpolated between the measured rows, not new measurements.

Four 280 by 280 crops of a synthetic green screen head at sensor noise sigma 16. Left: the noisy source, with visible grain across the green backdrop. Second: the alpha matte at 12% tolerance and 8% softness, showing scattered bright one-pixel specks in the backdrop and a grainy silhouette. Third: the same key after a 3 by 3 box blur, where the specks have merged into a bright halo around the head. Fourth: the same key after a 3 by 3 median, where the backdrop is almost clean and the silhouette is intact.
One 280×280 crop of the σ16 frame, shown as source and then as alpha mattes on a dark background. Left to right: (1) noisy source; (2) 12%/8% with no denoise — 2,023 backdrop pixels above alpha 8, 36 of them visible at alpha 128+; (3) 12%/8% after a 3×3 box blur — fewer speck pixels (468) but 223 visible and a 25-px largest blob, because the blur smears the subject into the backdrop; (4) 12%/8% after a 3×3 median — 3 pixels above alpha 8, 1 visible, and the edge is not smeared. The matte is the measured output of the same formula the browser keyer uses.

Denoise before the key, but not with a box blur

Denoising after the key is the wrong order. Once a backdrop pixel has been written to alpha 0, its colour is gone from the matte; filling it back in is hole repair, not denoising. The useful place is before the distance is computed, where the noise still looks like noise and a filter can remove it without inventing alpha.

But not every filter helps. A 3×3 box average is a low-pass filter: it turns isolated outliers into a smooth field, and near the silhouette it mixes the subject's own colour into the backdrop. The key then sees a gradient that was never in the scene. On the σ16 frame the box blur raised the 99.99th-percentile backdrop distance from 16.08% to 21.66% and the edge error by 39 levels, while leaving 223 visible pixels in a 25-px blob. A 3×3 median is different: it replaces a pixel with the middle value of its neighbourhood, so an isolated outlier disappears and a straight edge survives. It cut the floor to 11.69% and left 3 speck pixels. A temporal average is better still, but only if the camera and subject are static; it has no spatial blur at all.

Six repairs on the same σ16 frame, all keyed at 12%/8%. p99.99 and floor are recomputed after the repair. “Largest” is the biggest 4-connected speck in the backdrop. Edge Δ is against the clean σ0 frame at 12%/8%.
Repairp99.99 distanceFloorSpeck pxVisibleSpecksLargestEdge Δ
None16.08%19.08%2,023361,9982 px+3.0
Box 3×321.66%24.66%46822330725 px+39.0
Median 3×38.69%11.69%3131 px+2.7
Temporal ×39.46%12.46%000—+1.1
Temporal ×57.40%10.40%000—+0.3
Temporal ×95.68%8.68%000—−0.4

The temporal rows are an average of independent noisy frames with a static subject and a locked camera. That is the best case, and it is also common for a locked-off interview or a product shot. It is not available for a handheld shot or a moving subject: averaging unaligned frames blurs the edge the same way a box filter does. In that case use a median per frame, keep the tolerance at the measured floor, and accept that some grain will remain.

The order of operations that works

  1. Fix the capture before the slider. Lower the ISO or add light. Noise is the input to this whole problem; every stop of ISO you avoid is tolerance you do not have to spend.
  2. Measure a patch, not a pixel. Put a clean area of backdrop in the frame and sample at least 20 points across it, including the darkest corner. Convert each to distance with the keyer's formula and keep the largest. If you can run a script, use the 99.99th percentile instead of the maximum; one hot pixel should not set the whole frame's tolerance.
  3. Set tolerance at the floor. For a still, take that percentile and add 2–3 points. The extra points are not for noise; they are headroom for the softness ramp and for a slight exposure drift. Do not add 10 and hope.
  4. Denoise before the key. Median 3×3 on a still; a 3- or 5-frame temporal average only if nothing moved. Do not use a box or Gaussian blur as a pre-key denoiser; it lowers the speck count but raises the floor and eats the silhouette.
  5. Key, then check at 100%. Count backdrop pixels with alpha > 8, not just the ones you can see in a fit-to-window preview. A 2-px speck on a 4000-px frame is 0.6 screen pixels at 30% zoom. The edge-check page has the three-view method and measured thresholds.
  6. If the floor is above your nearest material, stop. At σ16 the floor is 19.08% and a green scarf is 15.87%. No tolerance clears the backdrop and keeps the scarf. Change the wardrobe, change the light, or roto the garment.

The browser keyer processes one still at a time and has no denoise control; it also caps the working canvas at 1400 px on the long edge. Denoise and measure in an editor or a script, export a PNG, then load that PNG into the keyer. For a video, export a frame sequence, apply the same per-frame treatment, key each frame, and re-encode with alpha; the container and export path are on the video page. The keyer does not read MP4, and this page does not pretend it does.

Questions that come up on a real shoot

Why do I get white dots instead of a green haze?

Because the key is a threshold, not a blend of the whole frame. Every pixel is tested on its own against the sampled green, and a noisy backdrop pixel either lands inside the tolerance ball (alpha 0) or outside it (alpha 255). The dots are the pixels that landed outside. They are white in the matte because the matte shows alpha, not colour; in the composite they may look green, grey or bright depending on what was stored in the RGB of that pixel. A haze would mean a broad region of partial alpha, which comes from a soft edge or a partly transparent object, not from per-pixel grain.

Should I denoise before or after keying?

Before. After the key, a backdrop speck is already alpha 0, so there is no colour left to filter; repairing it is hole filling, and a max-alpha fill grows the silhouette by the filter radius. Before the key, the speck is still a colour value and a median can remove it without touching alpha. The measured order effect is the same one that makes despill run after the key: each operation should see the data it is designed to change.

Why does the matte look noisier than the footage?

Because alpha is a ramp, and the ramp is steep. At 3% softness, a 1% change in colour distance moves alpha by about 85 levels. A backdrop pixel that looks like a slightly uneven green in the source can swing from 0 to 85 to 255 between frames without ever looking like a hole in the RGB image. The alpha view also removes the colour that was hiding the variation: a 4-level green shift is invisible on a green wall and obvious as a white speck on black. A shooter using a delta keyer described exactly this — the footage got “more noisy after green background is cut” (Video SE 28625). The key did not add noise; it made the existing noise visible.

Is 22%/3% safe on noisy footage?

It was safe up to σ16 on this frame: 22%/3% left zero backdrop pixels above alpha 8, even though 12%/8% left 2,023. At σ24 it left 140 pixels, 38 of them visible, and at σ32 it left 4,100. That is a useful default, not a guarantee. The number that predicts it is the backdrop's 99.99th-percentile distance: when that plus your softness headroom exceeds 22%, the default starts to leak. Measure your own frame; a different camera, a different exposure and a different amount of chroma noise will move the crossing.

Why did my 3×3 blur make the matte worse?

A box blur is a low-pass filter, and the silhouette is the highest-contrast thing in the frame. Near the edge it averages subject colour into backdrop pixels, so the key sees a band of colours that are neither the backdrop nor the subject. On the σ16 frame that raised the backdrop's 99.99th percentile from 16.08% to 21.66%, left 223 visible pixels in a 25-px blob, and added 39 levels of edge error. The speck count fell from 2,023 to 468, which is exactly the trap: fewer dots, a worse matte.

Will another light fix the noise?

If the noise is sensor noise and the extra light lets you lower the ISO, yes — and it is the only fix that improves the source instead of hiding it. In this model the tolerance floor tracks the noise level almost linearly: 7.04% at σ4, 11.16% at σ8, 19.08% at σ16. Halving the noise roughly halves the floor, which buys back the headroom you need for a near-key wardrobe. If the grain is compression noise or chroma noise from a small sensor, more light helps less; test with a single frame before you relight the set. A shooter asked whether two lights would solve his DSLR green-screen noise (Video SE 28780); the honest answer is that light helps the sensor-noise part and does nothing for the compression part.

Can I average frames to remove noise from a video?

Only when the camera and the subject are static. A temporal average of 3 aligned frames cut the floor from 19.08% to 12.46% and removed every speck; 5 frames took it to 10.40%, 9 frames to 8.68%. If anything moves, the average blends different edges and produces ghosting, which is the same failure as a spatial blur but spread over time. For a moving shot, use a per-frame median or a dedicated denoiser, and do not expect the floor of a static average.

Does this apply to phone photos and JPGs?

Yes, with two additions. A phone JPG has already been denoised and compressed, so its grain is blotchy and correlated rather than independent per pixel; the same measurement works, but the distribution has a longer tail than Gaussian noise. And the browser keyer's 1400-px cap means a 12 MP photo is reduced before you see the matte, which hides small specks. Inspect a 100% crop of the exported PNG, not the fit-to-window preview. The JPG page covers the compression side; the no-upload page has the size arithmetic.

Next step

Open the green screen remover on one still and look at the backdrop at 100% before you move the tolerance. If the leftover is a broad green cast on the subject, that is spill; if it is a ring of partial alpha along the silhouette, that is an edge problem; if it is isolated dots scattered across the backdrop, it is this page. For the starting values that keep hair and skin, use the measured tolerance table, and for a backdrop whose brightness varies across the frame, measure the spread first on the uneven-backdrop page.