Decoding RAW without Bayer interpolation to single greyscale

Dear developers,

thanks for a great RAW converter. I'm looking for one feature that might be there but hidden:

I'd like to convert all 4 color channels (RGGB) into a single image without any Bayer pattern interpolation (like "unprocessed raw" does). I'd like to use this image for sensor testing purposes, and the object is pure B&W.
In principle, one could use the unprocessed Raw and regard it as native resolution B&W file. However, since these 4 channels have different internal gains, the resulting image has a distinct pattern from the color filters. For example, the range for the Green pixels is 0-2000, while red only has 0-800. This results in an image where every red pixel is much darker than the other pixels. I'd like to adapt the gain for each color channel seperate, so in this specific case the red channel needs to be rescaled to values from 0-2400 too. A type of white balance for B&W if you will.

Now, "unprocessed raw" gives the option to adapt the gain, but this uses a single gain for all channels. Is there an option to change the gain per channel, or even better, use an "white balanced" gain?

(I'm using sony ARW files from a Nex-7.)

Thank you,


I was just wondering if you'd

I was just wondering if you'd had any success with this? I'm considering my options for creating multiple full-resolution, non-bayer, non-interpolation, monochrome/grayscale camera for a Raspberry Pi. I could try and remove the bayer filters from all of them, but this is trick and could easily cause damage. I'd much rather process the Raw files from the cameras (v2 8MP) to create monochrome, but with the red, green and blue scaled correctly...

Imagine scene, contains red

Imagine scene, contains red and blue surfaces (patches), shot via camera with color (bayer) filters.

Red/Blue (pixel values) ratio on red will be much higher than R/B ratio on blue patch. This is how a color camera works.

There is no way to fix it via single (per channel) gains, R/B(red) always will be higher than R/B(blue), regardless of gain used.

So, demosaic (i.e. recovering of missing color values), than RGB -> grayscale conversion looks like the only way to go.

-- Alex Tutubalin