What is a color key?

Color keying is a technique that makes every pixel close to one chosen color transparent, which removes a solid background without needing to outline the subject.

By · Updated

Want the full walkthrough? Read: Triim vs remove.bg, Photoroom, and Canva BG remover →

Explained in more detail

A color key is the single color you tell software to remove. Every pixel whose color is close enough to the key becomes transparent. Pick the white of a product photo's backdrop, for instance, and the white disappears while the product remains.

"Close enough" is measured as a distance between two colors. Triim's remove-background tool uses the straight-line (Euclidean) distance between the red, green and blue values of a pixel and the key color. A tolerance setting from 0 to 255 decides how far a pixel may differ and still be removed. A low tolerance only removes near-exact matches. A high tolerance removes more, but starts eating into subjects that share colors with the background.

An optional feather softens the cut: pixels just outside the tolerance get partial transparency instead of a hard edge, which hides the staircase look.

Color keying works well on clean, evenly lit, single-color backgrounds: logos on white, studio product shots, screenshots. It does not understand objects. It cannot separate a person from a busy room, and it will punch holes in a white shirt if the background is white. For those cases an AI segmentation tool is the right choice.

The advantage of keying is that it is deterministic, instant, and can run entirely in the browser. The same settings always give the same result.

Related terms

Try it in Triim

Further reading

Part of the Triim image terms glossary, by Rocco Bombardieri.