darktable-org / darktable-org/darktable
For the modern workflow, treat user-set WB just like 'as shot to reference'
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 13.1k
- Forks
- 1.4k
- Avg merge
- 22h 14m
- Merged PRs (30d)
- 198
Description
Is your feature request related to a problem? Please describe.
as-shot to reference uses multipliers from the camera to ensure a better WB (important for demosaicing and highlight reconstruction) than what camera reference (D65) would provide. However, the user can pick an even better set of multipliers by sampling an area of the image. In fact, some images (especially those shot with 'UniWB' -- see https://discuss.pixls.us/t/experimenting-with-icc-preference-profile-and-working-profile/54473) have a horrible set of in-camera multipliers. Those multipliers should be treated the same way as in-camera ones.
Describe the solution you'd like
Replace double as_shot[4] in dt_dev_chroma_t with double effective_coeffs[4] or similar. In temperature.c, set late_correction to true not only for "as shot to reference", but also for "by spot" and "user defined", if the scene-referred workflow is used. Update all code that relies on in-camera multipliers to use effective_coeffs, including color calibration, which reads coefficients directly from the image (find_temperature_from_raw_coeffs) -- I think as_shot should be the same (except for normalisation -- extracted from the same image data; temperature.c#reload_defaults -> _find_coeffs).
Alternatives
Leave as-is, one can simply turn off color calibration for those special images and use 'legacy' WB.
I'm willing to take this on, but will need support from core devs.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in temperature.c and inspect dt_dev_chroma_t, including reload_defaults and _find_coeffs. Trace the color-calibration path through find_temperature_from_raw_coeffs and every use of in-camera multipliers. Done means scene-referred by-spot and user-defined white balance use the effective coefficients for late correction and related color-calibration behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100