Add new comment

I guess, you've forget to

I guess, you've forget to subtract black level?

As a 1st step, use
imgdata.colordata.black - base level
imgdata.colordata.cblack[0..3] - per-channel additions

This should be done before white balance.

-- Alex Tutubalin @LibRaw LLC