Skip to content

blendop.cl: use the work profile's matrix for Lab channel display - #22330

Open
masterpiga wants to merge 2 commits into
darktable-org:masterfrom
masterpiga:fix_lab_overlay
Open

masterpiga wants to merge 2 commits into
darktable-org:masterfrom
masterpiga:fix_lab_overlay

Conversation

@masterpiga

Copy link
Copy Markdown
Collaborator

Another bug found while working on Flexi.

With OpenCL enabled, displaying a Lab channel of a parametric mask (L, a, b, C or h) shows a solid color instead of the channel. blendop_display_channel converts the displayed gray back to Lab with the work profile, but passes profile_info->matrix_in, the blend profile's matrix, which is not set up when blending in Lab. This change uses work_profile_info->matrix_in, as the CPU path does (dt_develop_blendif_lab_blend). It has been there since 7657ec9.

To reproduce: with OpenCL on, set a module's blend colorspace to Lab, enable a parametric mask, and display any of its Lab channels, for example by hovering a channel slider with channel display active. The center view turns into a solid color, black in monochrome mode and blue for b in false color. RGB channels and the CPU path are unaffected. Tested by forcing the channel display on both paths: after the fix, OpenCL matches the CPU output (identical for b, within 1/255 for L).

Co-authored with Claude.

The OpenCL channel display converts the displayed gray back to Lab
through the work profile, but took the matrix from the blend profile,
which is unset when blending in Lab. Every Lab channel then showed as
a solid color.
@masterpiga masterpiga added this to the 5.8 milestone Sep 19, 2026
@masterpiga masterpiga added bugfix pull request fixing a bug difficulty: trivial some changes in a couple of functions scope: image processing correcting pixels OpenCL Related to darktable OpenCL code priority: medium core features are degraded in a way that is still mostly usable, software stutters labels Sep 19, 2026
@TurboGit

Copy link
Copy Markdown
Member

I cannot reproduce with current master, I have used contrast equalizer, set a blending on the C channel, pressed m to display mask and got this:

image

Which seems correct to me.

Or maybe there is something else to reproduce the issue?

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 difficulty: trivial some changes in a couple of functions OpenCL Related to darktable OpenCL code priority: medium core features are degraded in a way that is still mostly usable, software stutters scope: image processing correcting pixels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants