How to convert a raw image to TIF without demosaic?

Since I would like to take a closer look at raw images, I wonder, how I could convert a raw image into a tif-file without demosaicing. I would like to just see what the detector sees.

Hermann-Josef

thats easy, go to the raw tab and the first module is “color interpolation” or something like that (in English), maybe even demosaicing. There you select “none” in the drop down list. If I do this, my raws basically look very green.

dcraw -D -T -4 should do it.

You’re going to be staring at a quite dark, monochrome depiction.

If you’re seeing green, you’re not quite there.

yes, there is also “mono”, which will look grey. but why do you think that’s not there? afaik the pixels on the sensor are red, green and blue, and there are more green pixels then red and blue.

Each “pixel location”, or sensel in the parlance of the semiconductor folk, measures a single value for the light intensity that presents itself there. The sensor itself doesn’t know it to be a particular color, except that the light was filtered for the particular band of the mosaic.

Oooh, Ooh, I recently modified my software to better show some of this, here goes:

First screenshot shows a raw file opened without any modification, pretty much what dcraw -D -T -4 would put into a TIFF:

With nothing done to the image array, all you can depict is the individual measurements. Note the pattern, that comes from the red, green and blue filters over each location. Now, let’s “color” those according to the respective filters. When I wrote my demosaic tool, I included an option that, instead of demosaicing the image, colors the pixels according to the filter:

To be clear, this is NOT a valid image operation, it’s just a teaching tool. In this depiction, the overall image would look “greenish” as the mosaic has more green measurements than red or blue. Even then, that’s probably not what you’re seeing in RawTherapee, that is probably pre-white-balance.

All that said, the first is the closest depiction to the raw measurements.

@betazoid, @ggbutcher

Thanks for your fast replies. Yes, I expect to have a dark, grey-scale image. That’s what it is supposed to be if it is the “real” detector signal. The colors only come in during demosaicing.

Hermann-Josef

Disclosure: the screenshots I posted do show one transform, that being the conversion from unsigned int 0-16385 to float 0.0-1.0. That’s my internal image format. And, that internal format is RGB, but for this data each R=G=B. That’s how I was able to “color” the mosaic, for each location in the RGGB quad, I drove the other two values to 0.0.

I think the most “untransformed” extraction of the raw data is dcraw -D -T -4.

The colours also can come in by colouring the pixels according to their color in cfa without demosaic.

@heckflosse
As Glenn pointed out, the detectors “see” no colour. If one colours the pixels according to their filters this is only symbolic.

What does cfa mean?

Hermann-Josef

Of course it’s only symbolic.

color filter array

Messed around with rawproc zoom limits last night. The screenshots I posted above are at the hard-coded limit, 500%, which begins to ‘lay flat’ for viewing the pixel pattern. So, I removed the hard-code number, and cranked it into the 3000% range. This is what I saw:

:smile:

3 Likes