diff --git a/rtengine/shmap.cc b/rtengine/shmap.cc index 65c1070a2..a92264117 100644 --- a/rtengine/shmap.cc +++ b/rtengine/shmap.cc @@ -85,12 +85,21 @@ void SHMap::update (Imagefloat* img, double radius, double lumi[3], bool hq, int if (!hq) { fillLuminance( img, map, lumi); + float *buffer = nullptr; + + if(radius > 40.) { + // When we pass another buffer to gaussianBlur, it will use iterated boxblur which is less prone to artifacts + buffer = new float[W * H]; + } + #ifdef _OPENMP #pragma omp parallel #endif { - gaussianBlur (map, map, W, H, radius); + gaussianBlur (map, map, W, H, radius, buffer); } + + delete [] buffer; } else {