Extreme camera white balance is off in RawTherapee

GitHub is definitely the place to report issues, but discussing whether a thing is an issue is appropriate here. However, to do that, we need a raw file that instigates the problem. Post one here, and we then have a basis for a discussion…

1 Like

Okay, Glenn and Desmis. I have uploaded three UV images to Google Disk in raw. One where RT won’t read the WB, while it is nearly possible to set WB. In the other sample image, the one I posted in the OP, it isn’t possible to set WB, and naturally, RT won’t read the in-camera custom set WB.

EDIT: To make things clear, regarding RT not reading the camera WB, I also added an image shot with a monochrome converted camera, where the camera profile naturally is set to B&W. As you can see in RT, it gets pink when opening, while it is purely grayscale in the thumbnail.

I haven’t added sidecar files. You can create your own.

Here’s the link:

https://drive.google.com/drive/folders/11Uts-gVIeLpBaSwNFk1WWQSfuYgc4PYA?usp=sharing

I think, to check if there are no adverse effects, we can increase the maximum value of “tint” to 25
The first images, is processed correctly by “RGB grey” or Pick. It is impossible obvioulsly to operate “Temperature correlation” here.

For the second image, only in manual…

I modified two constants in “Colortemp.h” and “Whitebalance.cc” #define MAXGREEN 25.0

Jacques

The picture you post here is the one that barely reach a WB. The other shot is far from reaching neutral. My tests with UV images show that the Kelvin scale is wide enough, but the tint (magenta/green) scale needs to be wider in the green end.

@LarsHP

Okay, but what do we do? The code I modified (2 lines) will not change “by itself” in “Dev”…I think you will want to test. Perhaps we can make other (complex) modifications but I don’t see which ones.
So in summary we can make this small improvement (to verify).

The world of “UV” photos is unknown to me, you can judge the results

In this case, you must open an “issue”

Jacques

1 Like

Sooo… I downloaded your raws and did some picking in my hack raw processor. My RT version is 5.9, will get to that in a minute. Firstoff, for those following along, both .ARWs have the same raw white balance settings in the metadata:

[MakerNotes] WB_RGGBLevelsAuto: 2524 1024 1024 1496  (2.46484375,1,1,1.4609375)
[MakerNotes] WB_RGGBLevels: 600 1024 1024 528   (0.5859375,1,1,0.515625)

(I added the decoded multipliers in parentheses)

Anyway, with my hack software I opened each raw and processed to linear RGB, and found the selected “as-shot” white balance corresponds to the WB_RGGBLevels tag values. I confirmed that these white balance multipliers indeed produce the white-balance evidenced in the embedded JPEGs, so there’s that.

Then, switched out the as-shot values with the WB_RGGBLevelsAuto values in both images, and I got pinkish/magenta renders for both. I then went to open both in RawTherapee, and for both images the Camera white balance used these RGB mulitipliers: 5.6579,1,3.8512. These numbers do not correspond with any of the metadata, but they do come close to the numbers calculated by the Automatic → RGB grey mode.

So yeah, I think RawTherapee isn’t doing something right with respect to as-shot white balance for this Sony camera.


Note: White balance after the image is encoded is no longer about temp/tint, it’s about what multipliers it takes to make the channels line up with white. When raw processors cobble together a temp/tint setting, they’re doing a very coarse approximation that IMHO confuses things more than it clarifies. So, I’ll not discuss temp/tint in any of these deliberations…

3 Likes

Thanks, Jacques. If you are already a member of the developer / coding team, I would love if you could take this suggestion up in the right forum / group.
Or do you want me to make an account on GitHub and post about it myself?

Thanks, Glenn, for confirming the issue. As you point it out, I now remember that I made custom WB for only one of the filters that day in order to see the difference between the two.

(I had reached the max post count in the first 24 hours as a new member, so had to wait to answer.)

To be fair, “white balance” was always about visible spectrum and once you’re out of that, you’re sort of on your own. For infrared, wb means “what colors you want” since the color doesn’t actually exist :rofl:

3 Likes

Indeed and how does one “balance” the classic bi-chromatic IR capture which has no green values at all?

@LarsHP

To open an issue you have to go there and create an account.

Click on the lnk.

But if you can’t do it I will open the issue myself this afternoon

Of course a priori it is a problem of amplitude of adjustments. The white balance system depending on the software works with channel multipliers or temperature/tint settings. There is a mathematical link between the two.
The system with temperature is more intuitive, because it is close to the notion of illuminant and the black body temperature options (Max Planck - T^4 function). In Auto WB, “Temperature correlation” only works with Temperature and tint. Another example Ciecam only works with Temperature and illuminant.

Changing the GUI, to introduce the modification of the WB by the multipliers will be complex, will not serve much purpose (if not make it more complex). So at least from me don’t expect a modification on this side.
I’m just going to change the amplitude of “green” (tint) which is at most 10 today to bring it to 30.
I will also add (GUI) a logarithmic scale for “tint” (green) for more intuitive use

Jacques

3 Likes

@LarsHP

I opened an “issue” and a Pull-Request (PR).
https://github.com/Beep6581/RawTherapee/issues/7044

PR
https://github.com/Beep6581/RawTherapee/pull/7043

Preferably use this PR for discussions

Executables are being developed here. (I hope) - “uvgreen”
https://github.com/Beep6581/RawTherapee/releases/tag/pre-dev-github-actions

Jacques

1 Like

Big thanks to you, Jacques!

I can see that you already have done some work on the software, in addition to putting up the request. Great to see!

When the expansion of the color adjustments are implemented, I am sure there will be quite a few happy photographers and scientists at www.ultravioletphotography.com .

Photo Ninja appears to be popular among UV photographers, because most other raw-converters aren’t able to fully correct the false colors to neutral. Having RawTherapee among the few would be very welcome!

For reference, here is an 11-year-old discussion about how to make colors in UV reproducible:

Thanks for the link which is good food for thought …

… and it features the well-respected Andrea.B who knows a thing or two about filters and stuff! :grinning:

1 Like

@LarsHP

Thank you for the link
I just made a change suggested by @Lawrence37 so that the value 1 is exactly in the middle of the slider scale.
If no one objects, I’ll merge soon

jacques

1 Like

It sounds like a good idea to have a center-value like 1 (or zero, if applicable).

Please post here when the new update is ready for download, thanks.

Best regards,
Lars

@LarsHP
The default is 1, so this is “in the middle”.
The executable has been available since this morning; Text with “uvgreen”

https://github.com/Beep6581/RawTherapee/releases/tag/pre-dev-github-actions

Jacques

Great! Thanks a lot again.
Do I understand it correctly, that the zip-file ending with uvgreen_win64_release is the one I should download and install?
About when do you expect there will be an “official” or non-beta version available for download? (The usual download page still has version 5.10 from Feb 16th as the newest.)

EDIT: Unfortunately, 40 isn’t enough to fully correct the magenta cast. When placing the WB color picking tool on the right-hand gray scale patches (below the “checker” text), it becomes clear that there is still a green cast, even though I have max’ed out the tint.

Yes, the file with “uvgreen” is the one you should download.

In fact you have several “downloads”

If no one objects, tomorrow, I will merge the “PR” into “dev”, that is to say transform the test version (pre-dev) into a current version.
But you will only find this modification in the official version during the next update to 5.11 (when ??)

Jacques

Hi Jacques. Please see my edit above. I just added:

Unfortunately, 40 isn’t enough to fully correct the magenta cast. When placing the WB color picking tool on the right-hand gray scale patches (below the “checker” text), it becomes clear that there is still a green cast, even though I have max’ed out the tint.

OK, I put 50