From d187c2e20b7f7ad070b674009277a2177ba1dfcb Mon Sep 17 00:00:00 2001 From: Alberto Griggio Date: Sun, 5 Nov 2017 16:05:50 +0100 Subject: [PATCH] Fattal: raised threshold on black pixels clipping to avoid pixel artifacts --- rtengine/tmo_fattal02.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rtengine/tmo_fattal02.cc b/rtengine/tmo_fattal02.cc index f17371100..9146fb09b 100644 --- a/rtengine/tmo_fattal02.cc +++ b/rtengine/tmo_fattal02.cc @@ -1082,20 +1082,20 @@ void ImProcFunctions::ToneMapFattal02(Imagefloat *rgb) Array2Df L(w, h); const float epsilon = 1e-4f; + const float luminance_noise_floor = 65.535f; + const float min_luminance = 1.f; #ifdef _OPENMP #pragma omp parallel for if (multiThread) #endif for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { - Yr(x, y) = std::max(Color::rgbLuminance(rgb->r(y, x), rgb->g(y, x), rgb->b(y, x)), epsilon); // clip really black pixels, otherwise it doesn't work at all (not sure why...) + Yr(x, y) = std::max(Color::rgbLuminance(rgb->r(y, x), rgb->g(y, x), rgb->b(y, x)), min_luminance); // clip really black pixels } } // median filter on the deep shadows, to avoid boosting noise { - const float luminance_noise_floor = 65.535f; // 0.1% -- is this ok? - #ifdef _OPENMP int num_threads = multiThread ? omp_get_max_threads() : 1; #else