From 54372877be8b194a54ea2b1a4d454986e692216c Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Fri, 28 Nov 2025 15:31:33 +0100 Subject: [PATCH] cmm: make white_balance behave like plasma --- src/cmm/cmm_luminance.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cmm/cmm_luminance.rs b/src/cmm/cmm_luminance.rs index 3cbb31ee..90b57274 100644 --- a/src/cmm/cmm_luminance.rs +++ b/src/cmm/cmm_luminance.rs @@ -69,10 +69,11 @@ impl Default for Luminance { #[expect(non_snake_case)] pub fn white_balance(from: &Luminance, to: &Luminance, w_to: (F64, F64)) -> ColorMatrix { - let a = ((from.max - from.min) / (to.max - to.min) * (to.white - from.min) + let a = ((from.max - from.min) / (to.max - to.min) * (to.white - to.min) / (from.white - from.min)) .0; - let d = ((from.min - to.min) / (to.max - to.min)).0.max(0.0); + // let d = ((from.min - to.min) / (to.max - to.min)).0.max(0.0); + let d = 0.0; let s = a - d; let (F64(x_to), F64(y_to)) = w_to; let X_to = x_to / y_to;