RawTherapee's CIECAM02 module

I change behavior of the 2 sliders “La”.

Now, it is as “temp” non linear, because most of values (especially for Viewing conditions) are between 0.01 and 100) on a scale 0… 16384

:slight_smile:

IEEE Xplore seems to require a membership before allowing access to the text, otherwise just supplying an abstract. Here are alternative links for the two IEEE articles:

https://www.researchgate.net/publication/266341203_A_Color_Balancing_Algorithm_for_Cameras

The researchgate website brings up suggestions for related articles, so I ended up reading several other articles, mostly just scanning quickly.

One method of auto white balancing that was mentioned in one of the articles - that maybe isn’t in the RT autowb branch? - is making the chromaticity histograms line up, which can be “sort of” done in GIMP (well, in GIMP-CCE) by outputting the image in the camera input color space (assuming a well-behaved linear gamma input profile), putting a 50% gray layer over the top using LCH Lightness blend mode, making new from visible, and then using Levels to push the Red, Green, and Blue channels around until their peaks line up.

This “match the chromaticity histograms” approach seemed to produce reasonable colors in one of the two test images that I’ve been experimenting with. This image is of a pond with lily pads, shot under bright sunlight. For some reason using “Daylight” white balance in RawTherapee (and all the other raw processors I’ve tried) turns the lily pads to magenta. There are some blown-out areas in the sparkles in the water around the lily pads, but not in the actual lily pads.

Another approach that was mentioned in some of the articles has to do with “dark” something or other (sorry, I forget the exact phrase) - is this like white balancing by moving the raw file black points? Or by looking only at dark areas in the image, on the assumption that shadows are usually neutral in color? Or something else altogether? - obviously I was scanning quickly instead of paying attention!

The best “auto white balance” I’ve seen for the “lily pads” image is the result of using GIMP-CCE’s “Levels/Auto Input Levels” (the reason I specify “CCE” is because in default GIMP there are issues with getting Levels to operate properly on images that aren’t in the sRGB color space, and additional issues with getting Levels to operate on linearized sRGB, if the image is already an sRGB image, plus sRGB isn’t a good color space for white balancing an interpolated raw file).

The other test image that I’ve been experimenting with is a grey card held half in direct sunlight, half in deep shade (very sunny “clear blue sky” day). As might be expected, the “edge”-based algorithms fail badly on this image.

Auto iterate temperature doesn’t actually work yet, yes? Leastways it produces bright orange on both of my test images.

So currently, at least when Transition is at maximum, I think the white balance set in the White Balance module doesn’t yet affect results?

From testing, it seems the gamma/cat02/etc options aren’t yet supposed to be working? Do they require also activating the CIECAM02 module?

I couldn’t figure out how to add a second “control point” - I think this is what you mean, using two control points, one for sunlight and one for shadows? This would seem difficult to use in images where shade and direct sunlight are intermixed, but maybe I don’t understand the UI.

Are the various auto-white-balance algorithms and modules activated before or after the image is interpolated?

I can provide my two test raw files if they might be of use. They are from my Canon 400D, so only about 10 megs each.

Elle

Thanks for testing.

Actually “white balance local and auto” work as I concepted…Ie, not very well and curiously for the user

  1. I began this work 5 years ago, then I stopped for various reason

  2. I did not list all the academic texts, they are very numerous, and some ask for an “inscription” (what you did).
    For each of the methods that I adapted the principle, the teams of researchers affirm that their method is the best, proof in support with test images.
    I think there is not a “good” method, but “methods” suitable for certain types of images

  3. for “local”,
    You have to start from an image that has already had a white balance applied and you apply a local correction.
    For example, assume an image with T=5045K and green=1.072
    If you apply a T = 6800K and green = 0.995 correction to a shaded area, the system will place the zone in the transitionless part at 6800K, g = 0.995, and then between this zone without transition and the remainder of the zone, Image at 5045K, g = 1.072, a transition will be performed
    For local, no gamma, no cat02
    I think, 2 or 3 spots is enough, but there is no difficulties to have 500 if need…

  4. for “auto”
    The modifications gamma and cat02 work, but they must be put before triggering the algorithm “auto”

  5. I will work on what I think is the best algo, “auto iterate temperature correlation”, but it needs much time, this algo is mine, different from what you read.

  6. algo (except old grey WB) is after demoisaicing.

  7. recall - I am always in vacation with my family, I work when I have time :slight_smile:

Finally started playing with RT and color temp and found this thread, and I think it’s really uncanny that I started jamming CIECAM into MyPaint with this exact goal in mind :slight_smile:

1 Like