Color Key Mode
colorkey-mode
The colorkey-mode parameter chooses how colorkey measures how close a pixel is to the key color. It has no effect without colorkey.
| Value | Measures | Use for |
|---|---|---|
color (default) | Red, green and blue, including brightness | White, gray, black and other solid backgrounds |
chroma | Color only, ignoring brightness | Green and blue screens with uneven lighting |
chroma matches the method and defaults of video-mark-chromakey in the Video API, so a color key behaves the same on images and video. Switching modes also changes the defaults of the other color key parameters:
| Parameter | color default | chroma default |
|---|---|---|
colorkey-tol | 20 | 54.09 |
colorkey-feather | 30 | 18.03 |
colorkey-defringe | 1 | 0.5 |
In chroma mode the tolerance is much wider, because ignoring brightness means a green screen’s lit and shadowed areas all have to fall inside one range. The feather and defringe defaults are narrower, since a saturated key separates from the subject more cleanly and needs less edge correction.
When Not to Use Chroma Mode
Because chroma ignores brightness, it cannot tell white, gray and black apart, and it treats every low-saturation color as close to a gray or muted key. Keying a white background in chroma mode removes the whole image. Use the default color mode for neutral and muted backgrounds.
Saturated subject colors near the key hue can also be partly removed in chroma mode. For example, a cyan subject is close to a green key. Lower colorkey-tol if that happens.
colorkeymode is accepted as an alias.

