Skip to content

colorcalibration also for manual wb#20304

Open
kofa73 wants to merge 22 commits intodarktable-org:masterfrom
kofa73:colorcalibration-also-for-manual-wb
Open

colorcalibration also for manual wb#20304
kofa73 wants to merge 22 commits intodarktable-org:masterfrom
kofa73:colorcalibration-also-for-manual-wb

Conversation

@kofa73
Copy link
Contributor

@kofa73 kofa73 commented Feb 8, 2026

Addresses #19873

  • added a new checkbox, prepare data for color calibration to white balance temperature.c to explicitly control the late_correction flag in 'user' / 'manual' modes

    • the checkbox is only visible in such modes (late_correction is always off in 'camera reference' mode, always on in 'as-shot to reference')
    • if switching from 'camera reference' or 'as-shot to reference' to a 'user' mode, the checkbox is automatically ticked if color calibration is enabled
  • replaced reference chr->as_shot with chr->wb_coeffs in highlights.c, colorin.c, opposed.c and segbased.c

  • illuminants.h:

    • added a new illuminant, DT_ILLUMINANT_FROM_WB, plus handling in conditionals, similar to DT_ILLUMINANT_CAMERA, but relying on dev->chroma->wb_coeffs
    • find_temperature_from_raw_coeffs:
      • renamed to find_temperature_from_as_shot_coeffs
      • extracted the logic to find_temperature_from_wb_coeffs, to allow directly using coefficients from temperature.c, instead of always going through ratios relative to the D65 values
      • added param wb_coeffs to illuminant_to_xy for absolute coefficients from temperature.c; renamed param custom_wb to correction_ratios to express what it represents; passed to find_temperature_from_wb_coeffs in DT_ILLUMINANT_FROM_WB mode
  • channelmixerrgb.c:

    • _dev_is_D65_chroma no longer needs as_shot multipliers in late_correction mode
    • renamed _get_white_balance_coeff to _get_d65_correction_ratios
    • wired up the calls to find_temperature_from_wb_coeffs to handle DT_ILLUMINANT_FROM_WB

    Draft for now, to allow discussion (and I haven't tested much, but wanted to make the changes visible to others; plus, I need to clean up some temp files)

@ralfbrown
Copy link
Collaborator

Did you intend to include cmixer_orig.c.txt in the PR?
And are the two .md files in the right place?

@kofa73
Copy link
Contributor Author

kofa73 commented Feb 9, 2026

Did you intend to include cmixer_orig.c.txt in the PR? And are the two .md files in the right place?

See the end of the description:

Draft for now, to allow discussion (and I haven't tested much, but wanted to make the changes visible to others; plus, I need to clean up some temp files)

@TurboGit TurboGit marked this pull request as draft February 9, 2026 16:07
@kofa73 kofa73 force-pushed the colorcalibration-also-for-manual-wb branch from 6631dc3 to be0ad7a Compare February 9, 2026 17:41
@kofa73
Copy link
Contributor Author

kofa73 commented Feb 9, 2026

@ralfbrown : extra files removed, thank for your patience

@kofa73 kofa73 marked this pull request as ready for review February 13, 2026 19:33
@kofa73 kofa73 changed the title Draft: colorcalibration also for manual wb colorcalibration also for manual wb Feb 13, 2026
…te_correction flag for 'legacy' modes (DT_IOP_TEMP_AS_SHOT, DT_IOP_TEMP_SPOT, DT_IOP_TEMP_USER)
…ERA (then gradually separate them, in small steps)
…re_from_as_shot_coeffs; factored out find_temperature_from_wb_coeffs
…MERA in many cases; what to do with illuminant_to_xy?
@kofa73 kofa73 force-pushed the colorcalibration-also-for-manual-wb branch from be0ad7a to ce74cf6 Compare February 13, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants