Closed heckflosse closed 7 years ago
While testing #3858, I detected that for some Sensors Auto-Level is completely wrong. Especially for foveon Sensors and Leica Monochrome sensors. Should be also wrong for Canon mraw/sraw, but for these I don't have test files atm.
Suggested Fix:
diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index e178906..11bdeb6 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -4613,13 +4613,13 @@ void RawImageSource::getAutoExpHistogram (LUTu & histogram, int& histcompr) } } else if (ri->get_colors() == 1) { for (int j = start; j < end; j++) { - tmphistogram[(int)(refwb_red * rawData[i][j])]++; + tmphistogram[(int)(refwb[0] * rawData[i][j])]++; } } else { for (int j = start; j < end; j++) { - tmphistogram[CLIP((int)(refwb_red * rawData[i][3 * j + 0]))]++; - tmphistogram[CLIP((int)(refwb_green * rawData[i][3 * j + 1]))] += 2; - tmphistogram[CLIP((int)(refwb_blue * rawData[i][3 * j + 2]))]++; + tmphistogram[CLIP((int)(refwb[0] * rawData[i][3 * j + 0]))]++; + tmphistogram[CLIP((int)(refwb[1] * rawData[i][3 * j + 1]))]++; + tmphistogram[CLIP((int)(refwb[2] * rawData[i][3 * j + 2]))]++; } } }
I found some mraw files. Just searched for mraw here. As expected before patch auto-levels for mraw files was wrong too. After patch it's much better.
Any objections to push this for 5.1?
for me :+1:
While testing #3858, I detected that for some Sensors Auto-Level is completely wrong. Especially for foveon Sensors and Leica Monochrome sensors. Should be also wrong for Canon mraw/sraw, but for these I don't have test files atm.
Suggested Fix: