darktable-org / darktable

darktable is an open source photography workflow application and raw developer
https://www.darktable.org
GNU General Public License v3.0
9.79k stars 1.14k forks source link

Color artifacts when using 4-way color balance rgb global offset #14796

Closed groutr closed 10 months ago

groutr commented 1 year ago

Describe the bug

When CB rgb is activated and the global offset in the 4-ways tab is used, I get severe color artifacts when hue is set to roughly 120 degrees and any nonzero chroma. This happens with both CPU/GPU. The artifacts consistently show in any shadow areas.

Steps to reproduce

  1. Select a photo (preferable one with strong shadows)
  2. Enable CB and in 4-ways tab under global offset, set hue to 120 degrees and chroma to .50%
  3. Observe the color artifacts in deep shadow areas.

Expected behavior

Not produce color artifacts.

Logfile | Screenshot | Screencast

No response

Commit

No response

Where did you install darktable from?

self compiled

darktable version

4.5.0.r31.gddfd69e06c

What OS are you using?

Linux

What is the version of your OS?

Archlinux

Describe your system?

this is darktable 4.5.0+31~gddfd69e06c copyright (c) 2009-2023 johannes hanika https://github.com/darktable-org/darktable/issues/new/choose

compile options: bit depth is 64 bit normal build SSE2 optimized codepath enabled OpenMP support enabled OpenCL support enabled Lua support enabled, API version 9.1.0 Colord support enabled gPhoto2 support enabled GraphicsMagick support enabled ImageMagick support disabled libavif support enabled libheif support enabled libjxl support enabled OpenJPEG support enabled OpenEXR support enabled WebP support enabled

Are you using OpenCL GPU in darktable?

Yes

If yes, what is the GPU card and driver?

Intel NEO

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

20230612_015801 Hue: 120 degrees, Chroma: 0.50%

20230608_023840 Hue: 101 degrees, Chroma: 0.50%

ralfbrown commented 1 year ago

Looks like a gamut issue - the half percent global chroma is in fact a pretty strong correction overall (it's half the default range of the slider), and more so in the shadows. At around 120 degrees, this is forcing the blue channel to go negative, and it is clipped to prevent math problems later in the pipe. Bumping up the luminance compensates and eliminates the color artifacts.

groutr commented 1 year ago

I posted extreme settings so the problem was more easily visible. As I stated in the first post, it happens with any nonzero chroma (even with .02%).

The luminance trick is nice though. I didn't try that. Even just a tiny adjustment fixes most of it.

github-actions[bot] commented 1 year ago

This issue has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.