diff --git a/rtengine/rawimage.cc b/rtengine/rawimage.cc index 53914694a..02f6e42c5 100644 --- a/rtengine/rawimage.cc +++ b/rtengine/rawimage.cc @@ -839,6 +839,13 @@ int RawImage::loadRaw(bool loadData, unsigned int imageNum, bool closeFile, Prog profile_data = new char[profile_length]; memcpy(profile_data, libraw->imgdata.color.profile, profile_length); } + + if (isBayer() && RT_blacklevel_from_constant == ThreeValBool::T && max(black, cblack[0], cblack[1], cblack[2], cblack[3]) == 0) { + auto &black_stat = libraw->imgdata.color.black_stat; + for (int i = 0; i < 4; ++i) { + cblack[i] = black_stat[i] / (1+black_stat[i+4]); + } + } } if (!float_raw_image) { // apply baseline exposure only for float DNGs