Keying Node fails with values above 1 #53371

Closed
opened 2017-11-21 15:28:24 +01:00 by Sebastian Koenig · 7 comments

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.
clipping_keyingnode.blend

**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. [clipping_keyingnode.blend](https://archive.blender.org/developer/F1167129/clipping_keyingnode.blend)
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @sebastian_k

Added subscriber: @sebastian_k
Sergey Sharybin was assigned by Sebastian Koenig 2017-11-21 15:28:56 +01:00
Author
Member

Added subscriber: @SeanKennedy

Added subscriber: @SeanKennedy

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

P561: Patch for #53371

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

might work good for you. Give it a try!

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 [P561: Patch for #53371](https://archive.blender.org/developer/P561.txt) ``` diff --git a/source/blender/compositor/operations/COM_KeyingOperation.cpp b/source/blender/compositor/operations/COM_KeyingOperation.cpp index e2566d2f4f0..873a537efe3 100644 --- a/source/blender/compositor/operations/COM_KeyingOperation.cpp +++ b/source/blender/compositor/operations/COM_KeyingOperation.cpp @@ -74,8 +74,9 @@ void KeyingOperation::executePixelSampled(float output- [x], float x, float y, Pix this->m_screenReader->readSampled(screenColor, x, y, sampler); const int primary_channel = max_axis_v3(screenColor); + const float min_pixel_color = min_fff(pixelColor- [x], pixelColor- [x], pixelColor[2]); - if (pixelColor[primary_channel] > 1.0f) { + if (min_pixel_color > 1.0f) { /* overexposure doesn't happen on screen itself and usually happens * on light sources in the shot, this need to be checked separately * because saturation and falloff calculation is based on the fact ``` might work good for you. Give it a try!
Author
Member

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...

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...

This issue was referenced by 6785a2bd66

This issue was referenced by 6785a2bd66f7f1c55098e4c71baa68ce3cc2bbf9

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#53371
No description provided.