Skip to content

Add color management to photometric color calibration

Adrian Knagg-Baugh requested to merge pcc_cm into master
  • Ensures the color temperature is correct in the user's working color space. The old code was hard coded and assumed a color space (I think linear sRGB, but I'm not entirely sure as there were no explanatory comments).

  • PCC should still be done on linear data, but color management ensures the colors will continue to look correct regardless of the RGB primaries of the user's chosen working color space.

  • Most of the work is done by lcms2, the only exception is the conversion from BV to color temperature and the reference for this calculation is provided in the code.

  • For the time being, the old code is used as a fallback in case creating the transformation fails for any reason. This is probably excessive caution: I'm pretty confident creating the transform should always work and I expect the old code should be removable.

  • Prints a warning if the image has a nonlinear color profile. If no color profile is attached, it will assign a linearised version of the user's preferred RGB color space and use that.

  • This represents a behaviour change and will therefore require a companion documentation MR.

Edited by Adrian Knagg-Baugh

Merge request reports