How do you view RAW Bayer mosaic image? (Canon)

Yowie Wowie

Senior Member
Messages
1,166
Solutions
2
Reaction score
622
How do I view/edit the image as captured by the sensor, before it has been demosaiced?

I have no practical usage in mind, just curiosity and experimentation

For my Canon 600D and 70D

Cheers
 
How do I view/edit the image as captured by the sensor, before it has been demosaiced?
There is no uniquely defined view on raw data before demosaicing. However, some of the open source raw converters allow to skip the step of demosaicing. You can for example try RawTherapee. There in the demosaicing properties you can choose between "none" or "mono". Both will not perform any color interpolation. The "none" mode still preserves an assignment of each pixel to its color channel as it is defined by the sensor's CFA. In mono you only see intensities.
 
Thanks
 
I don't think you can call it an image before demosaicing.
 
Makes me wonder what the definition of an image is.
 
I don't think you can call it an image before demosaicing.
Of course you can. It's an monochrome image and it looks in no way like the scene you captured, but it's still an image.
Makes me wonder what the definition of an image is.
Black and white is monochrome, is that not an image?

An image is anything you can see. A sine wave on an oscilloscope is an image. A drawing is an image. Human colour perception and actual electromagnetic intensity differ. An image in the infrared or ultraviolet range is still an image even if it has been colour mapped to the visible spectrum so humans can see it.

Think of the Bayer filtered sensor as 4 individual sensors interlaced together. Each sensor has a colour filter in front of it. 1 red, 1 blue, and 2 green. The camera is taking 4 separate monochromatic images at 1/4 resolution.
 
Last edited:
I don't think you can call it an image before demosaicing.
Unfortunately this view tends to mystify raw data more than it is adequate. Why not call it an image? It's just semantics, defining it not to be an image. Actually it is not a completely definied RGB image and demosaicing is the interpolation of the missing color information.

Here is an image, processed in RawTherapee with demosaicing mode "none". This assignes basically the value of a pixel to the channel it represents, while the other channels remain zero.

f06715a3c938442fa3b637f762ef981f.jpg.png

Another representation would be to assign the intensity value of the raw pixel to all RGB channels, resulting in a gray scale image:

87df35c053bb439e89b87ac301ddd133.jpg.png

Both versions may also be considered as a very specific but trivial kind of interpolation, since in both cases all RGB values are set. However, in particular the gray scale version can be seen as the direct representation of basically unaltered intentisity values saved by the sensor. And this is actually the input of of a demosaicing algorithm.
 
How do I view/edit the image as captured by the sensor, before it has been demosaiced?
There is no uniquely defined view on raw data before demosaicing. However, some of the open source raw converters allow to skip the step of demosaicing. You can for example try RawTherapee. There in the demosaicing properties you can choose between "none" or "mono". Both will not perform any color interpolation. The "none" mode still preserves an assignment of each pixel to its color channel as it is defined by the sensor's CFA. In mono you only see intensities.
So would "mono" offer an advantage in PP for B&W?

What I'm thinking is that displaying luminance at each and every pixel would eliminate any averaging or interpolation, and render a sharper image.
 
So is there a way to eliminate that "looking through a screen" effect? In a way it's kind of cool but it interferes with resolution.
 
So is there a way to eliminate that "looking through a screen" effect? In a way it's kind of cool but it interferes with resolution.
yes, demosaic the image and convert to b&w later :-P ...I guess you are talking about the pattern, which is visible when zooming in deeply? This actually the Bayer* pattern, resulting from the color filters placed in front of each pixel. Hence, from the portion of light reachinga pixel, it measures only the intensity of a certain color component. So the alternative solution may be to use a monochrome cam like the Leica, which simply has no color filter array in front of the pixels.

*) Actually, in this case it is not Bayer. The example picture was from a Fuji X-Trans cam. This, however, doesn't matter, since the color filters are only arranged a little different than on Bayer sensors.
 
I don't think you can call it an image before demosaicing.
Unfortunately this view tends to mystify raw data more than it is adequate. Why not call it an image? It's just semantics, defining it not to be an image. Actually it is not a completely definied RGB image and demosaicing is the interpolation of the missing color information.

Here is an image, processed in RawTherapee with demosaicing mode "none". This assignes basically the value of a pixel to the channel it represents, while the other channels remain zero.

f06715a3c938442fa3b637f762ef981f.jpg.png

Another representation would be to assign the intensity value of the raw pixel to all RGB channels, resulting in a gray scale image:

87df35c053bb439e89b87ac301ddd133.jpg.png

Both versions may also be considered as a very specific but trivial kind of interpolation, since in both cases all RGB values are set. However, in particular the gray scale version can be seen as the direct representation of basically unaltered intentisity values saved by the sensor. And this is actually the input of of a demosaicing algorithm.
This does not represent the real raw image, but it gives an idea. The real raw image is different: suppose you look at a part of the blue sky. All blue pixels will be rather bright in the raw data (because there was a lot of blue light), but the green pixels will be almost black (because there was hardly any green in the blue sky) and the red pixels will also be quite dark. The real raw image will not only be monochrome, you will also see a distinct pattern caused by the Bayer filter. These images do not show any pattern, because RawTherapee is still doing some kind of interpolation.

But you're right and that was my point too. Whatever the image looks, it's still an image.

--
Johan
http://www.johanfoto.com
 
Last edited:
I don't think you can call it an image before demosaicing.
Unfortunately this view tends to mystify raw data more than it is adequate. Why not call it an image? It's just semantics, defining it not to be an image. Actually it is not a completely definied RGB image and demosaicing is the interpolation of the missing color information.

Here is an image, processed in RawTherapee with demosaicing mode "none". This assignes basically the value of a pixel to the channel it represents, while the other channels remain zero.

f06715a3c938442fa3b637f762ef981f.jpg.png

Another representation would be to assign the intensity value of the raw pixel to all RGB channels, resulting in a gray scale image:

87df35c053bb439e89b87ac301ddd133.jpg.png

Both versions may also be considered as a very specific but trivial kind of interpolation, since in both cases all RGB values are set. However, in particular the gray scale version can be seen as the direct representation of basically unaltered intentisity values saved by the sensor. And this is actually the input of of a demosaicing algorithm.
This does not represent the real raw image, but it gives an idea. The real raw image is different: suppose you look at a part of the blue sky. All blue pixels will be rather bright in the raw data (because there was a lot of blue light), but the green pixels will be almost black (because there was hardly any green in the blue sky) and the red pixels will also be quite dark. The real raw image will not only be monochrome, you will also see a distinct pattern caused by the Bayer filter. These images do not show any pattern, because RawTherapee is still doing some kind of interpolation.
The first image DOES show pattern. Use 'original size' image and expand to around 300%.

Here is a very small extract from the highlighted rectangle first below followed by some of that section expanded:-

4db0a500d0bf4c7183406bb9bdc363ea.jpg



9094745db494441888332f1be89add33.jpg

--
Cheers, Tony.
 
I don't think you can call it an image before demosaicing.
Unfortunately this view tends to mystify raw data more than it is adequate. Why not call it an image? It's just semantics, defining it not to be an image. Actually it is not a completely definied RGB image and demosaicing is the interpolation of the missing color information.

Here is an image, processed in RawTherapee with demosaicing mode "none". This assignes basically the value of a pixel to the channel it represents, while the other channels remain zero.

f06715a3c938442fa3b637f762ef981f.jpg.png

Another representation would be to assign the intensity value of the raw pixel to all RGB channels, resulting in a gray scale image:

87df35c053bb439e89b87ac301ddd133.jpg.png

Both versions may also be considered as a very specific but trivial kind of interpolation, since in both cases all RGB values are set. However, in particular the gray scale version can be seen as the direct representation of basically unaltered intentisity values saved by the sensor. And this is actually the input of of a demosaicing algorithm.
This does not represent the real raw image, but it gives an idea. The real raw image is different: suppose you look at a part of the blue sky. All blue pixels will be rather bright in the raw data (because there was a lot of blue light), but the green pixels will be almost black (because there was hardly any green in the blue sky) and the red pixels will also be quite dark. The real raw image will not only be monochrome, you will also see a distinct pattern caused by the Bayer filter. These images do not show any pattern, because RawTherapee is still doing some kind of interpolation.
The first image DOES show pattern. Use 'original size' image and expand to around 300%.

Here is a very small extract from the highlighted rectangle first below followed by some of that section expanded:-

4db0a500d0bf4c7183406bb9bdc363ea.jpg

9094745db494441888332f1be89add33.jpg

--
Cheers, Tony.
Thanks. It seems I had not zoomed in far enough on my iPad.

--
Johan
http://www.johanfoto.com
 
Last edited:
How do I view/edit the image as captured by the sensor, before it has been demosaiced?

I have no practical usage in mind, just curiosity and experimentation

For my Canon 600D and 70D
Remind the raw files are a special TIFF file with grey pixels that are interpreted by raw "developers" accordingly to return the color information.

Rawdigger is an interesting application capable (besides other features) to export a such "raw composite" TIFF file from an original raw file. You can also to choose to normalize the values or to maintain their original figures.



Raw composite from an original Nikon D810 NEF (just a small cropping)
Raw composite from an original Nikon D810 NEF (just a small cropping)

Regards,
--
O.Cristo - An Amateur Photographer
Opinions of men are almost as various as their faces - so many men so many minds. B. Franklin
 
The X-Trans CFA results in a strong green cast - I wonder if the Bayer CFA would show as strongly green?
 
The X-Trans CFA results in a strong green cast - I wonder if the Bayer CFA would show as strongly green?
It would. The majority of pixel is allocated to the green portion of incoming light. That's the case for Bayer sensors and even stronger for X-Trans.
 
Another representation would be to assign the intensity value of the raw pixel to all RGB channels, resulting in a gray scale image:

Both versions may also be considered as a very specific but trivial kind of interpolation, since in both cases all RGB values are set. However, in particular the gray scale version can be seen as the direct representation of basically unaltered intentisity values saved by the sensor. And this is actually the input of of a demosaicing algorithm.
Not really. It is still just a representation, and an interpolation of what is actually captured by the sensor. Most RAW files are 10, 11 or 12 bit nowadays. That means every sensel has a capture range of theoretically 1024, 2048 or 4096 levels.

If you'd try to represent this data in an 8 bit grayscale mage, per pixel you would have room for 256 levels. Also in the 'bayer array representation', because you are still only using one color-channel per pixel.

So in short, a raw sensor data file is NOT an image file, but a data collection. It can be represented in the form of an image, just like you would represent data in a graph or with colors. But you would lose data because of the interpolation you would need to do.

Even if you would use a 16 bit image to represent the data, you could theoretically get all the raw data crammed in there, but your monitor you would view it on would have a LUT of a much shallower bit-depth, and you would not be able to view your file correctly.

I find it a bit of an academical discussion. If you COULD represent the raw numeric data as an image, what would it be practical for?
 
Last edited:

Keyboard shortcuts

Back
Top