From 344f2434326491b45fe3e675241192f19576b40b Mon Sep 17 00:00:00 2001 From: isiko Date: Thu, 16 Feb 2023 18:33:03 +0100 Subject: [PATCH] Fix Levels node gamma correction (#1034) * Fix Levels Node * Fix the fix --------- Co-authored-by: Keavon Chambers --- node-graph/gcore/src/raster/adjustments.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node-graph/gcore/src/raster/adjustments.rs b/node-graph/gcore/src/raster/adjustments.rs index ee197623..769b32c7 100644 --- a/node-graph/gcore/src/raster/adjustments.rs +++ b/node-graph/gcore/src/raster/adjustments.rs @@ -77,9 +77,9 @@ fn levels_node(color: Color, input_start: f64, input_mid: f64, input_end: f64, o // Gamma correction let gamma = if midtones < 0.5 { - (1. + (9. * (1. - midtones * 2.))).min(9.99) + 1. / (1. + (9. * (1. - midtones * 2.))).min(9.99) } else { - ((1. - midtones) * 2.).max(0.01) + 1. / ((1. - midtones) * 2.).max(0.01) }; // Input levels