Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.75k stars 313 forks source link

Drastic change in colors for minute change in color matrix 1 #5540

Open 10110111 opened 4 years ago

10110111 commented 4 years ago

I was trying to generate valid DNG files from my phone camera to be able to process in RawTherapee (checking on Ubuntu 18.04 RawTherapee 5.3). For some reason, it appears that if I go from the value of TIFF field with TIFFTAG_COLORMATRIX1 of

{1,    0,   0,
 0,  2.022, 0,
 0,    0,   1}

to

{1,    0,   0,
 0,  2.023, 0,
 0,    0,   1}

the colors in RawTherapee change drastically: from greenish tint to purple. See the following screenshots: Screenshot_20191125_082905 Screenshot_20191125_082752

I do admit that the files are not yet fully correct: e.g. AsShotNeutral field is currently a stub (1,1,1), but such a sensitivity of RawTherapee to minute changes in a diagonal element of the color matrix sounds suspicious, so I think it's a problem somewhere in RawTherapee.

The relevant test DNG files can be downloaded here (14MiB XZ archive).

Beep6581 commented 4 years ago

Maybe related to #5496

Entropy512 commented 4 years ago

Hmm... Yeah, I think #5496 may have a couple of subcomponents (most notably, your question of why ColorMatrix2 is being used when Auto-Matched Camera Profile is active). Some of those might be contributing?

iliasg commented 4 years ago

Interesting is what happens after passing the two DNGs through Adobe DNG Converter !! The colormatrix1 gets normalized to 0.4946 0 0 0 1 0 0 0 0.4946 - 0.4943 0 0 0 1 0 0 0 0.4943 and the rendering looks more reasonable (and almost identical for both DNG_1s) ;) colormatrix1-sRGB

Also interesting that the tint value is almost same as the central multiplier in colormatrix1 !!

Anyway .. looks like both the greenish an purplish renderings of the prototype DNGs are wrong because RT's WB calculations "crash" on the tint limits (10.0 or 0.02) colormatrix1-green-purple-sRGB

Beep6581 commented 4 years ago

To be tested whether this can still be reproduced in @Desmis 's white balance branches.