I have traced it to this commit by @jdc backporting something from ART, so @agriggio might also want to have a look for himself Improve HLreconstruction color propagation - best transitions - code … · Beep6581/RawTherapee@b554f52 · GitHub
What I don’t understand is why a core method was casually changed without mention anywhere.
1 Like
heckflosse
(Ingo Weyrich)
February 9, 2021, 9:01pm
13
That I also don’t understand. Even more, by that change it got a serious slowdown…
1 Like
jdc
(Desmis)
February 10, 2021, 5:05am
14
Sorry, its my fault.
Probably the best solution is to disabled this improvment
Promised, i won’t do it again
Sorry again
Jacques
Well, let’s Alberto have a look first. If things are not problematic in ART, then we might as well revert. But if things can be fixed, there may be a very nice improvement to the reconstruction.
jdc
(Desmis)
February 10, 2021, 6:22am
16
@Thanatomanic @heckflosse
This change followed a discussion on Darktable in january, and Alberto @agriggio made proposals to improve HR. They have been tested by ART users, and by myself. The improvement is significant.
But, it leads to a slowdown and in some cases to bad behaviour.
Considering the positive opinions, I didn’t go through the “issue” stage of RT, it’s a mistake? but who doesn’t make mistakes?
Sorry again
Jacques
agriggio
(Alberto)
February 10, 2021, 6:24am
17
I tried reproducing in ART but I couldn’t, fwiw
1 Like
nosle
(nosle)
February 10, 2021, 7:50am
18
I’ve also seen this. I use RCD/vng demosaic. It appears in the highlights with colour propagation.
@agriggio I can reproduce it in (edit: current dev build of) ART, can you try with this arp? S7_09850.ARW.arp (10.8 KB)
agriggio
(Alberto)
February 10, 2021, 8:29am
20
Confirmed, thanks! Here’s a fix (the patch is for ART, might need to be adapted for RT):
diff --git a/rtengine/hilite_recon.cc b/rtengine/hilite_recon.cc
--- a/rtengine/hilite_recon.cc
+++ b/rtengine/hilite_recon.cc
@@ -951,7 +951,7 @@
#endif
for (int y = 0; y < H2; ++y) {
for (int x = 0; x < W2; ++x) {
- guide[y][x] = Color::igamma_srgb(Color::rgbLuminance(rbuf[y][x], gbuf[y][x], bbuf[y][x], imatrices.xyz_cam));
+ guide[y][x] = CLIP(Color::igamma_srgb(Color::rgbLuminance(rbuf[y][x], gbuf[y][x], bbuf[y][x], imatrices.xyz_cam)));
}
}
}
I give you a photo to test.
You have to put ‘color propagation’
IMG_3346.DNG (18.3 MB)
jdc
(Desmis)
February 10, 2021, 9:41am
22
I tried with the patch Alberto @agriggio . there are always artifacts
But, If I replace CLIP by clipL
with
constexpr float clipL(float x)
{
return rtengine::LIM(x, 100.f, 65535.f);
}
Only is changed the low limit… 100.f, instead of 0.f
No artefacts (at least on this image)
But it not fixed IMG_3346.DNG
Jacques
afre
(Alan)
February 10, 2021, 9:52am
23
@stefan.chirila Nice image BTW.
1 Like
jdc
(Desmis)
February 10, 2021, 10:11am
24
Then, If now we change Guidedfilter parameter…artefacts are gone on IMG_3346.DNG
// guidedFilter(guide, mask, mask, 2, 0.001f, true, 1);
guidedFilter(guide, mask, mask, 3, 0.1f, true, 1);
jacques
agriggio
(Alberto)
February 10, 2021, 10:48am
25
Sorry, my previous “fix” was not enough… can you try this one?
diff --git a/rtengine/hilite_recon.cc b/rtengine/hilite_recon.cc
--- a/rtengine/hilite_recon.cc
+++ b/rtengine/hilite_recon.cc
@@ -946,12 +946,17 @@
rescaleNearest(gsrc, gbuf, true);
rescaleNearest(bsrc, bbuf, true);
+ LUTf gamma(65536);
+ for (int i = 0; i < 65536; ++i) {
+ gamma[i] = pow_F(float(i)/65535.f, 2.2f);
+ }
+
#ifdef _OPENMP
# pragma omp parallel for
#endif
for (int y = 0; y < H2; ++y) {
for (int x = 0; x < W2; ++x) {
- guide[y][x] = Color::igamma_srgb(Color::rgbLuminance(rbuf[y][x], gbuf[y][x], bbuf[y][x], imatrices.xyz_cam));
+ guide[y][x] = gamma[CLIP(Color::rgbLuminance(rbuf[y][x], gbuf[y][x], bbuf[y][x], imatrices.xyz_cam))];
}
}
}
jdc
(Desmis)
February 10, 2021, 11:44am
26
@agriggio
Alberto
I just tested with your patch, no more artifacts with the 2 images IMG_3346.dng and S7_09850.ARW
jacques
1 Like
jdc
(Desmis)
February 10, 2021, 12:09pm
27
1 Like
thanks @afre was from a trip to a rental cottage/cabin on Lake Erie (Ontario) last year.
Thanks a bunch everyone can’t wait to download the appimage with the fix
nosle
(nosle)
February 15, 2021, 7:05pm
30
I this supposed to be fixed in RT dev? I recompiled yesterday evening but saw artifacts in overexposed sky that disappeared when switching to blend highlight reconstruct.
heckflosse
(Ingo Weyrich)
February 15, 2021, 7:14pm
31
No, but perhaps in branch hilitrecon
, which also speeds up colour propagation…
Edit: for reference:
Beep6581:dev
← Beep6581:hilitrecon
opened 02:24PM - 10 Feb 21 UTC
In the beginning of January a new color propagation inpaint method was ported fr… om ART. A bug was found (https://discuss.pixls.us/t/issue-with-black-blotches-help/23378) and a fix was suggested by @agriggio and implemented by @Desmis. This PR is made for easy testing.
1 Like