How to have RT to apply profile ForwardMatrixWhitebalance1 factors to see image in white balance as shot?

In my use case I try to reproduce the actual scene illumination as shot with an industrial camera where I create the DNG files from scratch from the raw pixel data. The profile creation with dcamprof works fine and produces good results already regarding the color correction.

But I also like to view the scene under its actual illumination when shot. How to achieve that in RawTherapee? Currently this does not appear to be possible as when disabling white balance in RT, I don’t see any difference in the effective neutral color patch rendering when loading manually modified profiles with different ForwardMatrixWhitebalance1 factors and I neither see a difference when loading profiles created for different illuminants. The color correction of course changes slightly between different illuminant profiles as expected, but the rendering of the neutral patches stays the same.

My question: How to activate applying of the ForwardMatrixWhitebalance1 Rfactor, Gfactor, Bfactor in RT?

My current workaround is to process the image on the command line with imagemagick and apply the ForwardMatrixWhitebalance1 factors there.

My guess is that DNG files from commercial cameras have some other entry in the DNG files which is read by RT and then applied to render as shot.

Reading further into my topic I found in the section “White balance and camera profiles” on
DCamProf this:

Note that a DCP profile cannot be made to “correct” white balance, that is change your “As Shot” white balance multipliers to something else. In some reproduction setups you may want to do that, and for this you need to use an ICC profile instead.

With that, it appears that for my use case just the DNG profile alone (DCP) won’t work as it won’t correct the differences in the intensities between the raw camera channels and leaves that balancing to the separate white balance process.

That makes perfect sense for the normal use case of commercial cameras which always write their measured white balance factors into the DNG file. But as I don’t have those factors as I create the DNG from scratch with just having the raw pixel data and nothing else, it won’t work for my use case. I could of course switch to ICC profiles, but that has other disadvantages I think.

But I think I found a workaround now by modifying my created DNG files.

Took a few reads to fully parse your post, but now I think I have a sense of it…

I’ve used ICC profiles to correct white balance in the same operation as the color transform, and it works somewhat better than using the multipliers. I use the LittleCMS library in my software to do the color transforms, and it knows enough to do the necessary chromatic transform.

I think if you shoot a colorchecker shot in the same light as the scene and make a ICC camera profile from an un-white balanced rendition of it, you’ll achieve your objective. Don’t know what you’d be missing vice using a DCP…

Yes, now with an ICC profile instead of DCP it works how I need it. make-icc with parameter -W and I don’t miss anything yet and have the LUT also there. Some years ago when I tried the same with ICC I had all kinds of problems, but those were caused most likely by the wrong approach as tried it with embedding the ICC profile into the final image and almost no standard software like normal JPG/PNG image viewers in the OS and web browser were able to render it correctly.

1 Like