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:
@@ -72,7 +72,7 @@ const SETTINGS = {
|
|||||||
outputBps: 16,
|
outputBps: 16,
|
||||||
outputColor: 0,
|
outputColor: 0,
|
||||||
noAutoScale: true,
|
noAutoScale: true,
|
||||||
useCameraWb: false,
|
useCameraWb: true,
|
||||||
noAutoBright: true,
|
noAutoBright: true,
|
||||||
gamm: [1, 1] as [number, number],
|
gamm: [1, 1] as [number, number],
|
||||||
userQual: 3,
|
userQual: 3,
|
||||||
@@ -367,8 +367,13 @@ export async function developRaw(bytes: Uint8Array): Promise<Uint8Array> {
|
|||||||
const effect = Skia.RuntimeEffect.Make(RAW_DEVELOP_SKSL);
|
const effect = Skia.RuntimeEffect.Make(RAW_DEVELOP_SKSL);
|
||||||
if (!effect) throw new Error('develop shader failed to compile');
|
if (!effect) throw new Error('develop shader failed to compile');
|
||||||
|
|
||||||
const green = cd.cam_mul[1] || 1;
|
const rawMul = (cd?.cam_mul && cd.cam_mul.some((v: number) => v > 0 && v !== 1))
|
||||||
const mul = cd.cam_mul.map((v) => v / green);
|
? 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 row = (i: number) => cd.rgb_cam[i].slice(0, 3);
|
||||||
const [r0, r1, r2] = [row(0), row(1), row(2)];
|
const [r0, r1, r2] = [row(0), row(1), row(2)];
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
f434fd494a98a7c0b280d2dd9bc142f00faf399436c068735bc854c911a64046 recipescam-images.tar.gz
|
60f452b2fa01abce7084a4e347b9c222a27d2bc63d8bbfec1cf75727cc29b2e9 recipescam-images.tar.gz
|
||||||
|
|||||||
Reference in New Issue
Block a user