Green Screen Remover for Two Colors at Once: Green + Blue Key

Two backdrops, two tolerances, one alpha matte. A working local keyer, the measured window where a blue key starts eating blue jeans, and the FFmpeg mask chain that does the same to video.

Short answer: two backdrops in one shot — a green wall and a blue floor, or two greens lit differently — need two key colors, not one wider tolerance. The tool below samples both, tests every pixel against each, and keeps the smaller alpha in a single pass. It also has a separate tolerance per color, so a shadowed blue screen does not force the green key open. Nothing is uploaded.

Drop an image here, or
A
B
Click on the image samples into

Waiting for an image. The file is read in this tab and never uploaded.

Both keys start on: green #00b140 at 14% and blue #0047bb at 14.5%. If your shot has only one backdrop, turn the other key off. Re-loading this tool's own PNG is safe — it keeps the incoming alpha instead of overwriting it.

Why two key colors need two tolerances

The matte is the smaller of the two alphas: a pixel counts as background if either key calls it background. That is the whole rule behind the tool above:

alpha = min( alphaA(pixel), alphaB(pixel), incomingAlpha )

Separate tolerances matter because the two backdrops are rarely equally even. In the measured frame below, the lit green sits 0% from its key while the green shadow sits 13.25% away; the blue backdrop spans 0% to 14.39%. One shared slider would have to cover both spreads, and the wider one drags the narrower key into the subject.

Test pixelDistance from greenDistance from blueAlpha, A at 14%Alpha, B at 14.5%Final
Green backdrop, lit #00b1400.00%36.76%02550
Green backdrop, shadow #007a2c13.25%34.37%02550
Blue backdrop, lit #0047bb36.76%0.00%25500
Blue backdrop, shadow #00327f32.10%14.39%25500
Skin midtone #d9a07a51.00%55.10%255255255
White shirt #e6ece665.60%64.82%255255255
Black hair #14141437.19%39.79%255255255
Blue jeans #2b4a7a28.48%17.66%255255255
Teal jacket #1f6f6a19.05%21.62%255255255
Green shirt #2f7d3f15.87%32.42%159255159

Measured 2026-10-24 with the same RGB-distance formula and 3% edge softness used by the tool above. Alpha 0 is fully transparent, 255 fully opaque. Distance is Euclidean RGB distance divided by 441.67, the maximum possible distance.

Two things in that table are worth stopping on. The blue jeans survive at 14.5% by 0.16 of a point — and the green shirt does not survive at all: 15.87% is only 1.87 points past key A's 14% tolerance, so it comes out half transparent (alpha 159). The second key did not do that; the first one did.

The blue key's safe window is 0.27 points wide

The shadowed blue backdrop is 14.39% from the blue key. Denim at #2b4a7a is 17.66% away. With 0% softness you could pick anything between those two numbers, a 3.27-point band. Add the default 3% softness and the band collapses:

Tolerance BBlue shadow, Δ 14.39%Blue jeans, Δ 17.66%What you see
14.0%alpha 33alpha 255A faint blue veil left in the shadow
14.5%alpha 0alpha 255Backdrop gone, jeans intact
15.0%alpha 0alpha 226Jeans start to thin
16.0%alpha 0alpha 141Jeans half transparent
18.0%alpha 0alpha 0Jeans gone; the backdrop is clean

Computed 2026-10-24 from the distances above with the page's alpha ramp; 3% softness on key B. Nothing here is a camera test — it is the arithmetic of the slider.

A pixel is fully transparent when its distance is at or below the tolerance, and fully opaque only when its distance is above tolerance + softness. Solving both conditions for this pair gives 14.39 ≤ t < 14.66: 0.27 points. That is not a tuning problem you can slide your way out of. Change the wardrobe, move the subject farther from the blue, or swap the blue for green.

Green is worse when the subject wears green. The green shadow is 13.25% out and a green shirt is 15.87% out. At 3% softness you would need t ≥ 13.25 and t < 12.87 at the same time — no such number exists. The window is empty. Only at 0% softness does a 2.62-point band open, and a hard matte is exactly what makes edges look cut out.

Why running the one-color keyer twice does not work

A single-color keyer writes alpha from the distance to its sampled color. It does not read the alpha it was handed. So if you key green, download the PNG, reload it, and key blue, the second pass re-evaluates the pixels that were already transparent:

PixelAfter green pass, A 14% + 3%After blue pass, B 14.5% + 3%Result
Green backdropalpha 0alpha 255The hole closes again
Green shadowalpha 0alpha 255The hole closes again
Blue backdropalpha 255alpha 0Removed by the second pass
Blue jeansalpha 255alpha 255Untouched
Skinalpha 255alpha 255Untouched

The blue key is 36.76% away from the green backdrop, so the second pass sees an opaque pixel and writes 255 back. Tested on 2026-10-24 in Edge with this site's single-color keyer: after the green pass the hole read RGBA 0,0,0,0; after reloading that PNG and keying blue at the tool's 22% default, the same pixel read 0,0,0,255 — a black patch where the green wall used to be. The transparent pixels had lost their color as well as their alpha. Two passes only work in a tool that multiplies the new matte with the incoming alpha, which is what the keyer above does.

You can test any keyer for this in thirty seconds: key a frame with an obvious hole, export the PNG, reload that PNG, run an unrelated key color, and look at the hole. If it fills in, the tool cannot do sequential keys — and no amount of re-sampling will fix it.

Two colors on video: two mattes, then keep the darker one

FFmpeg's chromakey writes alpha too, and putting two chromakey filters in a row does not combine them. Measured on a test strip: after chromakey=green,chromakey=blue, the green block came out at alpha 223 at the blue filter's 0.24 — exactly what the blue key alone produced. The second filter overwrote the first matte.

The working shape is split, key each color separately, combine the two grayscale mattes with a darken blend, then attach the result to the original frame:

ffmpeg -i in.mp4 -filter_complex "
[0:v]split=3[g][b][src];
[g]chromakey=0x00b140:0.08:0.03,format=rgba,alphaextract[mg];
[b]chromakey=0x0047bb:0.10:0.03,format=rgba,alphaextract[mb];
[mg][mb]blend=all_mode=darken[m];
[src][m]alphamerge,format=yuva420p[out]" \
-map "[out]" -c:v libvpx-vp9 -crf 30 -b:v 0 -cpu-used 5 -row-mt 1 out.webm

Tested 2026-10-24 on a 2-second, 30 fps, 600×100 clip built from six flat blocks. Alpha at the block centers after decoding: green 0, blue 0, skin 255, white 255, blue jeans 255, green shirt 255. ffprobe still reports pix_fmt=yuv420p, but the container carries TAG:alpha_mode=1; decoding with -c:v libvpx-vp9 and running alphaextract gave the same six numbers on frame 0.

Do not copy those two similarities into the browser tool. They are FFmpeg's YUV numbers, not the page's RGB percentages: at 0.24 FFmpeg's blue key turned a white block to alpha 0, while 24% on this page leaves white at 255. The only transferable part is the shape of the recipe.

The browser tool on this page is still a still-frame keyer. The command above is the video path; green screen remover for video covers containers and alpha checks, and the batch video page covers queues and per-file verification.

When two keys are the wrong fix

Two-color green screen remover FAQ

Can you remove a green screen and a blue screen at the same time?

Yes, if the tool combines two mattes instead of running one key after the other. The keyer above samples both colors, tests every pixel against each, and keeps the smaller alpha, so a pixel only survives when both keys call it foreground. A single key color cannot do this, and two passes in a tool that overwrites alpha will undo the first pass. If you are checking another tool, key a green frame, export, reload the PNG, key an unrelated color, and see whether the transparent hole fills in.

Why did my blue jeans turn transparent?

Because denim is close to the blue key. Measured with this page's formula, #2b4a7a sits 17.66% from #0047bb, while a shadowed blue backdrop sits 14.39% away. At 3% softness the only tolerance that clears the shadow and keeps the jeans fully opaque is 14.39–14.66%, a 0.27-point band. At 16% the jeans are alpha 141; at 18% they are alpha 0. A slider cannot widen a 3.27-point colour gap — move the subject off the blue, or use a green backdrop.

Should both keys share one tolerance?

No, and the measured spread is why. The green backdrop here ranges from 0% to 13.25% from its key; the blue ranges from 0% to 14.39% from its key. A shared value has to be at least 14.39% to clear the blue shadow, but that same value is already 1.14 points inside the green key's own shadow margin and 1.48 points from a green shirt. Two sliders let each backdrop use its own spread. Edge softness can stay shared because it describes how the matte fades, not how far the background color drifts.

What if both backdrops are green but lit differently?

Try one key first. If the two greens are 13.25% apart like the lit and shadowed samples above, a single 14% tolerance clears both, and a second green key adds nothing but another chance to eat the subject. Two keys earn their place when the two greens are far apart — for example a lit green wall and a dark green floor — or when one backdrop is green and the other is blue. If the subject contains green, one key is safer: the green shirt in the table fades to alpha 159 at key A's 14%.

Does this two-color keyer work on video?

Not directly. It decodes one image in the tab and exports a PNG; it does not open an MP4 or write a transparent video. For video, use the tested mask recipe above: split the frame, build one matte per color, darken-blend the two mattes, attach the result, and encode VP9 with alpha. That recipe is per frame, so it also handles a clip where the two backdrops move. The video page covers the container and alpha checks.

Why did my light blue items shift color after keying?

Because that keyer changed the pixels, not just their alpha. A real Video Stack Exchange question describes light blue and cyan props turning an unnatural blue after a chroma key effect, while other keyers left those colors alone (question 14509). This page's keyer only writes the alpha channel; RGB is copied through untouched, so an object either stays exactly the same color or becomes transparent. Measured here, a teal jacket at #1f6f6a sits 21.62% from the blue key, outside the 14.5% default, so it stays fully opaque and keeps its color. A lighter cyan close enough to the key would vanish rather than shift. If colors move, the tool is applying spill suppression or a chroma blur, not a plain key.

Next step

Key your frame above, then take the transparent PNG into your editor. If one backdrop is enough, the single-color green screen remover has the plain workflow; if the edge still glows green, run it through the despill step after keying. For the prompt side of an AI video job, start at the Seedance 2.5 job builder or read the guides.