Applying WB to jpg/tiff in darktable and RawTherapee

My 2cts on this topic: strictly speaking, WB is only valid when applied to linear RGB values in the camera colorspace, and prior to any non-linear beautifying transform or RGB colour mixing (like a film emulation LUT).

Since in most cases it is not possible to know, and therefore “undo”, the exact processing that produced the jpeg or tiff file, the best approximation is probably to convert the RGB data to a reference linear colorspace before applying some linear multipliers to the RGB channels to alter the WB.

Moreover, in order to be able to still express the WB multipliers in terms of temperature/tint, the original multipliers must be known and reverted. Otherwise only relative multipliers can be applied, and no absolute conversion to temperature/tintbis possible AFAIK.