From 78c404dd02cd37550bb3b02a17150b3666040d38 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Mon, 14 May 2018 00:55:03 +0200 Subject: [PATCH] Microcontrast: improved blend --- rtengine/ipsharpen.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/ipsharpen.cc b/rtengine/ipsharpen.cc index 3cdc613df..920fcd6ae 100644 --- a/rtengine/ipsharpen.cc +++ b/rtengine/ipsharpen.cc @@ -656,7 +656,7 @@ BENCHFUN contrast = std::min(contrast, 1.f); float blend = 0.f; if(contrast <= contrastThreshold) - blend = sqrt((contrastThreshold - contrast) * contrastFactor); + blend = 1.f - (contrast <= contrastThreshold * 0.5f ? 0.f : sqrt((std::min(contrast, contrastThreshold) - contrastThreshold * 0.5f) * 2.f * contrastFactor)); //matrix 5x5 float temp = v + 4.f *( v * (s + sqrt2 * s)); //begin 3x3