Skip to content

Conversation

@jenshannoschwalm
Copy link
Collaborator

Some highlights code didn't work correctly, so an urgent fix. See #20167

Removing the snapper from demosaicing modify_roi_in lead to various problems in highlights reconstruction module, so let's keep it. It got unnoticed likely because almost-always peoply just stay with opposed ... Arrgh. Anyway, reintroducing the snapper doesn't hurt at all as we over-calculate the canvas so smooth moving-around works still perfectly.

To test here is
Busker in Shadow.zip

There is still one annoying issue here on AMD/rustiCL, if i zoom in or just drag the main canvas around there are very strong artefacts, Very bad colors, sometimes the whole screen is blu or red ...

So i would like you all to test on your systems and report. There are some parts of the OpenCL code that are definitely out-of-1.2 specs, for sure that worked correctly some time ago on my nvidia system.
@TurboGit @piratenpanda (yes the video was like what i have but much-much more annoying here) @MStraeten as on mac please.

@jenshannoschwalm jenshannoschwalm added this to the 5.4.1 milestone Jan 20, 2026
@jenshannoschwalm jenshannoschwalm added bugfix pull request fixing a bug priority: release critical cannot release until fixed labels Jan 20, 2026
@piratenpanda
Copy link
Contributor

Should this change the artifacts because it still looks the same as before for me?

Some pre-demosaic code still requires snapping to sensor pattern.
@jenshannoschwalm
Copy link
Collaborator Author

  1. There were issues when using the visualizing button when not in opposed/segmentation mode, now fixed.
  2. You should watch out for artefacts while using laplacian mode.
  • issues while --disable-opencl should be gone now.
  • while using opencl, do you see artefacts (as shown on your video?)

@jenshannoschwalm
Copy link
Collaborator Author

@TurboGit i would suggest to merge this now for master and 5.4.1

About the OpenCL issues, it used to work on my nvidia system but does not on AMD. After more reports i would know more - possibly we might want to disable on AMD for now.

1. In some OpenCL kernels we want to make sure we read valid data making sure we don't take negatives/NaN
   from image. This has always been an issue with AMD hardware when using some optimizer flags.
2. Observed artefacts resulted from opacity outside the 0-1 range when rewriting the cfa data.
   This was happening on CPU and OpenCL codepath.
3. False color representation didn't work correctly in OpenCL code path.
@jenshannoschwalm jenshannoschwalm changed the title Reintroduce demosaic snapping for stability Fix highlights reconstruction issues Jan 20, 2026
@jenshannoschwalm
Copy link
Collaborator Author

Friends, got it. For laplacian hightlights there were two issues:

  1. On OpenCL we make sure to read proper input data - as we have done so often for AMD hardware
  2. For both OpenCL and for CPU codepath we must make sure the opacity while reblending reconstructed data is within the 0-1 range.

@Jiyone you might also be interested :-)

Release note:
Fixes artefacts in laplacian highlights reconstruction

@jenshannoschwalm
Copy link
Collaborator Author

@TurboGit added 3rd commit, that's just simple maintenance so not necessarily for 5.4.1

@Jiyone
Copy link
Contributor

Jiyone commented Jan 20, 2026

@Jiyone you might also be interested :-)

Huu ? 🤔

@piratenpanda
Copy link
Contributor

Confirmed fixed for me

@TurboGit TurboGit merged commit 1793d3a into darktable-org:master Jan 20, 2026
5 checks passed
@TurboGit TurboGit self-requested a review January 20, 2026 17:53
Copy link
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was all good on my side, merged in master & 5.4.x branch. Thanks!

@jenshannoschwalm jenshannoschwalm deleted the fix_varios_highlights branch January 20, 2026 19:27
@MStraeten
Copy link
Collaborator

sorry wasn't able to check earlier on mac - I'm not sure if i exactly got the issue:
before: on zooming the colour rendition of the blown out areas changes to a blueish magenta and sometimes back
after: the color rendition is constant during scaling

@TurboGit
Copy link
Member

@jenshannoschwalm : The commit Reintroduce demosaic snapping for stability has introduced 9 regressions:

  • 0006-orientation-plus-90
  • 0007-orientation-180
  • 0009-flip-v
  • 0010-flip-hv
  • 0096-lensfun
  • 0097-sigmoid
  • 0145-lens-metadata-xtransIV-modversion-6
  • 0146-lens-metadata-xtransIV-modversion-7
  • 0151-sigmoid-no-hue-preservation

I need your feedback to understand this. Why only those? I mean the commit changes roi x, y for all RAW, so why only those tests are affected? They are all sharing the same 2 RAWs (mire1.cr2 & xtransIV.raf) with many other tests.

Probably because all of them are using flip/orientation or lens. Is that the proper explanation?

TIA

@jenshannoschwalm
Copy link
Collaborator Author

Is that the proper explanation?

Absolutely :-)

BTW i will do a rework on this making sure all pre-demosaic modules don't require this "snapping"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request fixing a bug priority: release critical cannot release until fixed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants