Skip to content

highlights: test each channel in the linear opposed mask kernel - #22917

Merged
TurboGit merged 1 commit into
darktable-org:masterfrom
nicknezis:highlights-opposed-linear-mask-kernel
Nov 1, 2026
Merged

TurboGit merged 1 commit into
darktable-org:masterfrom
nicknezis:highlights-opposed-linear-mask-kernel

Conversation

@nicknezis

Copy link
Copy Markdown
Contributor

Follow-up to #22894 and #22895, which both merged today. #22895 fixed the CPU mask in _process_linear_opposed() to test each channel against its own clip level. The OpenCL kernel from #22894 still tests red against all three, so on master, CPU and OpenCL disagree on linear raws with clipped highlights. This makes highlights_initmask_linear match the CPU.

Tested on a LinearRaw DNG made from hlrecovery.arw (greens clip, default opposed mode), PoCL:

opposed chroma CPU vs OpenCL, max
master CPU 0.3336 -0.0055 0.2359, OpenCL 0.3336 -0.0036 0.2491 3.9e-4
this PR both 0.3336 -0.0055 0.2359 1.3e-5

No release note: both #22894 and #22895 are in this cycle, so no release had the mismatch.

Not tested: a discrete GPU.

Written with Claude Code.

Follow the CPU fix in _process_linear_opposed(): highlights_initmask_linear
tests each channel against its own clip level instead of red against
all three.
@da-phil

da-phil commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Good catch, thank you for fixing it.
Looks like this wrong comparison has been around for quite a while.

@nicknezis

Copy link
Copy Markdown
Contributor Author

Good catch, thank you for fixing it. Looks like this wrong comparison has been around for quite a while.

Thanks! It came up while porting the linear opposed path to OpenCL.

@TurboGit TurboGit added this to the 5.8 milestone Nov 1, 2026
@TurboGit TurboGit added bugfix pull request fixing a bug scope: image processing correcting pixels OpenCL Related to darktable OpenCL code labels Nov 1, 2026

@TurboGit TurboGit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@TurboGit
TurboGit merged commit 76f33d9 into darktable-org:master Nov 1, 2026
10 checks passed
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 OpenCL Related to darktable OpenCL code scope: image processing correcting pixels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants