WB after interpolation

Hi, I hope that all feel fine despite this difficult time.
Well, I would have to say sorry, navre, if this topic has been discussed before.
But as far as I know about image processing pipeline, white balancing is done before CFA interpolation.
However, it is not the case with RT.
http://rawpedia.rawtherapee.com/Toolchain_Pipeline
Why is this ?
I guess that you had found some improvements (e.g. in relation to highlight recovery) when WB happens after demosaicing and decided to do so.
What is it ?
Is there no counter disadvantages in doing so ?

There is an auto whitebalancing applied before demosaic and a final white balancing after demosaic.

Thank you for a brief intervention.
Do you mean that this description is incorrect ?

“This descripiton” refers to: Toolchain Pipeline - RawPedia

It’s incomplete

If that is the case, your story is compatible with my understanding in usual image processing.

But what does an automatic white balancing beore interpolation look like ?

In terms of impact on the final image, it just means the image gets demosaiced better. Colors overall are not impacted.

@PCU2 Maybe this will help? Raw preprocessing WB by rom9 · Pull Request #5662 · Beep6581/RawTherapee · GitHub

Edit, and this: Allow usage of camera (or even user defined) white balance in raw preprocessing and demosaic · Issue #5616 · Beep6581/RawTherapee · GitHub

1 Like

Hi CarVac and Thanatomanic

Thanks for your interventions too.

In terms of impact on the final image, it just means the image gets demosaiced better. Colors overall are not impacted.

If so, why do most camera execute white balance before interpolation ?

I am still struggling to get what “an auto whitebalancing applied before demosaic” refers to.
When a raw file is developped by RT with WB off, the produced picture resembles ones by darktable(with WB off) and dcraw (-r1111) very much in their color.

It applies an auto white balance, demosaics, then undoes the auto white balance.

Again, what is an auto white balance that RT applies before CFA interpolation ?

With WB off, then RT only applies an auto white balance before demosaic.
But the result is not clearly different from the ones by darktable with WB off or by dcraw with -r1111.

Do you know what auto white balance is in general?

The effects of white balance on demosaicing are very subtle and you’ll basically only see them in areas of very high detail, when zoomed in very far.

There might not be big differences, but if you look at the earlier discussion and the issue on github you can see that in some cases it matters. Sometimes it is necessary to have a proper WB before demosaicing, or you would get artifacts later in the pipeline.
Edit: and to clarify, this pre-demosaic whitebalance has nothing to do with the user specified whitebalancing that takes place afterwards.

Do you know what auto white balance is in general?

Yes, if you refer to a function generally found in digital cameras. But should RT opearate such an automatic white balancing, the result must have been far from resemblance with dcraw -r1111.

Sometimes it is necessary to have a proper WB before demosaicing, or you would get artifacts later in the pipeline.

Is it sometimes or rather in general that is necessary to have a proper WB before interpolation given most camera do so ?

No, because it undoes the AWB after performing demosaic.

it undoes the AWB after performing demosaic.

Even when WB (after interpolation) is off ?

Can you provide a source for your claim that most camera’s have WB before demosaicing?
As for the always vs. sometimes: I don’t know. It may not provide any advantage in many cases, but it may give an advantage in some cases and even maybe a disadvantage in some other cases. It’s very hard to generalize here.