fix(raw): enable camera white balance multipliers and fallback extraction to fix RAW color cast on Olympus and other bodies

This commit is contained in:
2026-10-05 15:43:20 +07:00
parent 140b4f88b2
commit 480fd148a3
3 changed files with 9 additions and 4 deletions
+8 -3
View File
@@ -72,7 +72,7 @@ const SETTINGS = {
outputBps: 16,
outputColor: 0,
noAutoScale: true,
useCameraWb: false,
useCameraWb: true,
noAutoBright: true,
gamm: [1, 1] as [number, number],
userQual: 3,
@@ -367,8 +367,13 @@ export async function developRaw(bytes: Uint8Array): Promise<Uint8Array> {
const effect = Skia.RuntimeEffect.Make(RAW_DEVELOP_SKSL);
if (!effect) throw new Error('develop shader failed to compile');
const green = cd.cam_mul[1] || 1;
const mul = cd.cam_mul.map((v) => v / green);
const rawMul = (cd?.cam_mul && cd.cam_mul.some((v: number) => v > 0 && v !== 1))
? cd.cam_mul
: (cd?.pre_mul && cd.pre_mul.some((v: number) => v > 0))
? cd.pre_mul
: [1, 1, 1, 1];
const green = rawMul[1] || rawMul[3] || 1;
const mul = rawMul.map((v: number) => v / green);
const row = (i: number) => cd.rgb_cam[i].slice(0, 3);
const [r0, r1, r2] = [row(0), row(1), row(2)];
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
f434fd494a98a7c0b280d2dd9bc142f00faf399436c068735bc854c911a64046 recipescam-images.tar.gz
60f452b2fa01abce7084a4e347b9c222a27d2bc63d8bbfec1cf75727cc29b2e9 recipescam-images.tar.gz