Page MenuHome

Keying Node fails with values above 1
Closed, ResolvedPublic

Description

System Information
elementaryOS 0.4.1, GTX980ti

Blender Version
Broken: 2.79.1, 58a15b2

Short description of error
The Keying Node does not key colors with values above 1 correctly.
I noticed this behavior with badly lit greenscreen footage, which I had exported as EXR with Linear ACES colorspace. No matter what I try, all areas which are overexposed, with color values above 1, are not keyed at all.
Other keying nodes, such as the Chroma Key, work just fine.

Exact steps for others to reproduce the error
I have attached a file with a very simple example. There are 2 colors, one with green channel at 0.95, one with green channel at 1.05. The darker one keys just fine, but not matter how I set the key color or clip the blacks etc., the inner square simply doesn't key correctly. If you try with the Chroma Key or any other keying node it works just fine. I guess there is some internal clipping happening in the Keying Node. But since we are working in a linear color space this really should not be happening.

Event Timeline

Sergey Sharybin (sergey) triaged this task as Normal priority.Nov 21 2017, 4:46 PM

This is currently expected behavior to consider all over-exposured areas as a non-screen because well, screen shouldn't be over-exposured. This was a big issue back to Trears of Steel with footage like tech. head with lamp.

However, we might try tweaking the condition here, so for example

1diff --git a/source/blender/compositor/operations/COM_KeyingOperation.cpp b/source/blender/compositor/operations/COM_KeyingOperation.cpp
2index e2566d2f4f0..873a537efe3 100644
3--- a/source/blender/compositor/operations/COM_KeyingOperation.cpp
4+++ b/source/blender/compositor/operations/COM_KeyingOperation.cpp
5@@ -74,8 +74,9 @@ void KeyingOperation::executePixelSampled(float output[4], float x, float y, Pix
6 this->m_screenReader->readSampled(screenColor, x, y, sampler);
7
8 const int primary_channel = max_axis_v3(screenColor);
9+ const float min_pixel_color = min_fff(pixelColor[0], pixelColor[1], pixelColor[2]);
10
11- if (pixelColor[primary_channel] > 1.0f) {
12+ if (min_pixel_color > 1.0f) {
13 /* overexposure doesn't happen on screen itself and usually happens
14 * on light sources in the shot, this need to be checked separately
15 * because saturation and falloff calculation is based on the fact

might work good for you. Give it a try!

That patch works great, thanks a lot! :)
But man, the ToS footage was soo much better than the one I have to deal with right now...