Which YCbCr conversion does Blender's Chroma Key use, what range does it assume, and where else in the Keying node does the same conversion appear?
Blender's Chroma Key and the Keying node's chroma pre-blur convert RGB to studio-range BT.709 YCbCr (Y = 0.183R + 0.614G + 0.062B + 16, chroma centred at 128, computed on 0-255-scaled values and divided by 255), the same constants on GPU and CPU. Chroma Key rescales Cb/Cr with v*2-1, so neutral grey lands at +1/255 (about +0.0039) rather than 0. The algorithm is credited to Video Demystified, ch. 7. The CPU helper's own FIXME says its 16-235 range comment must be wrong.
Blender's Chroma Key and the Keying node's chroma pre-blur convert RGB to studio-range BT.709 YCbCr (Y = 0.183R + 0.614G + 0.062B + 16, chroma centred at 128, computed on 0-255-scaled values and divided by 255), the same constants on GPU and CPU. Chroma Key rescales Cb/Cr with v*2-1, so neutral grey lands at +1/255 (about +0.0039) rather than 0. The algorithm is credited to Video Demystified, ch. 7. The CPU helper's own FIXME says its 16-235 range comment must be wrong.
Curator qualifications: Code read 2026-10-22; Blender not built or run; arithmetic by hand. Keying-node blur details and extract/replace shaders carried from producer reading.
Limitations: Code read 2026-10-22; Blender not built or run; arithmetic by hand.
Evidence status: statements located in the cited sources by a correlated desk review (Claude); not executed; not independently reviewed.
Structured fields
{
"citations": [
{
"url": "https://github.com/blender/blender/blob/f46990f5f55e36cc771b0ce476512b89ecfcea23/source/blender/nodes/composite/nodes/node_composite_keying.cc",
"note": "gpu_shader_common_color_utils.bsl.hh L205-213; gpu_shader_compositor_chroma_matte.glsl; blenlib math_color.cc L135, L156-159"
},
{
"url": "https://github.com/blender/blender/blob/f46990f5f55e36cc771b0ce476512b89ecfcea23/source/blender/gpu/shaders/nodes/gpu_shader_common_color_utils.bsl.hh",
"note": "gpu_shader_common_color_utils.bsl.hh L205-213; gpu_shader_compositor_chroma_matte.glsl; blenlib math_color.cc L135, L156-159"
},
{
"url": "https://github.com/blender/blender/blob/f46990f5f55e36cc771b0ce476512b89ecfcea23/source/blender/compositor/shaders/library/gpu_shader_compositor_chroma_matte.glsl",
"note": "gpu_shader_common_color_utils.bsl.hh L205-213; gpu_shader_compositor_chroma_matte.glsl; blenlib math_color.cc L135, L156-159"
},
{
"url": "https://github.com/blender/blender/blob/f46990f5f55e36cc771b0ce476512b89ecfcea23/source/blender/blenlib/intern/math_color.cc",
"note": "gpu_shader_common_color_utils.bsl.hh L205-213; gpu_shader_compositor_chroma_matte.glsl; blenlib math_color.cc L135, L156-159"
},
{
"url": "https://github.com/blender/blender/blob/f46990f5f55e36cc771b0ce476512b89ecfcea23/source/blender/compositor/shaders/compositor_keying_replace_chroma.glsl",
"note": "gpu_shader_common_color_utils.bsl.hh L205-213; gpu_shader_compositor_chroma_matte.glsl; blenlib math_color.cc L135, L156-159"
},
{
"url": "https://github.com/blender/blender/blob/f46990f5f55e36cc771b0ce476512b89ecfcea23/source/blender/compositor/shaders/compositor_keying_extract_chroma.glsl",
"note": "gpu_shader_common_color_utils.bsl.hh L205-213; gpu_shader_compositor_chroma_matte.glsl; blenlib math_color.cc L135, L156-159"
}
]
}Evidence claims
- [sourced_fact] Blender's Chroma Key and the Keying node's chroma pre-blur convert RGB to studio-range BT.709 YCbCr (Y = 0.183R + 0.614G + 0.062B + 16, chroma centred at 128, computed on 0-255-scaled values and divided by 255), the same constants on GPU and CPU. Chroma Key rescales Cb/Cr with v*2-1, so neutral grey lands at +1/255 (about +0.0039) rather than 0. The algorithm is credited to Video Demystified, ch. 7. The CPU helper's own FIXME says its 16-235 range comment must be wrong. · locator: gpu_shader_common_color_utils.bsl.hh L205-213; gpu_shader_compositor_chroma_matte.glsl; blenlib math_color.cc L135, L156-159 source
Rights
| component | license | hosting | redistribution | modification | training | Evidence and notes |
|---|---|---|---|---|---|---|
| documentation | unknown | permitted | permitted | unknown | unknown | Applies to this original summary only, not to the cited sources. |
Linked records
- cites → https://github.com/blender/blender/blob/f46990f5f55e36cc771b0ce476512b89ecfcea23/source/blender/blenlib/intern/math_color.cc
- cites → https://github.com/blender/blender/blob/f46990f5f55e36cc771b0ce476512b89ecfcea23/source/blender/compositor/shaders/compositor_keying_extract_chroma.glsl
- cites → https://github.com/blender/blender/blob/f46990f5f55e36cc771b0ce476512b89ecfcea23/source/blender/compositor/shaders/compositor_keying_replace_chroma.glsl
- cites → https://github.com/blender/blender/blob/f46990f5f55e36cc771b0ce476512b89ecfcea23/source/blender/compositor/shaders/library/gpu_shader_compositor_chroma_matte.glsl
- cites → https://github.com/blender/blender/blob/f46990f5f55e36cc771b0ce476512b89ecfcea23/source/blender/gpu/shaders/nodes/gpu_shader_common_color_utils.bsl.hh
- cites → https://github.com/blender/blender/blob/f46990f5f55e36cc771b0ce476512b89ecfcea23/source/blender/nodes/composite/nodes/node_composite_keying.cc