# Debayered cameras?



## TiCoyote (Jan 11, 2017)

I've been enjoying shooting B&W film, but I wonder if I can get better results with less time/effort/money in digital.  Shooting digital and then converting to B&W has some drawbacks.  You can't use a red filter.  You can PP a red filter, but it's not quite... the same.  

There's the Leica Monochrom, but it's pricey.  

I was thinking about buying a used 5D2, and sending it off to one of these companies that removes the low-pass AA filter and also removes the Bayer array.  

Does anyone here have any experiences with this or thoughts?


----------



## jcdeboever (Jan 11, 2017)

TiCoyote said:


> I've been enjoying shooting B&W film, but I wonder if I can get better results with less time/effort/money in digital.  Shooting digital and then converting to B&W has some drawbacks.  You can't use a red filter.  You can PP a red filter, but it's not quite... the same.
> 
> There's the Leica Monochrom, but it's pricey.
> 
> ...


Personally, I have done a great deal of research on this both physically and carefully (internet). Fujifilm appears to be light years ahead of everyone else on film simulation mode inside the camera. Not sure your budget but you want to look at the X-series. I brought a card into a store and played around with the X100T and the X-T2. Pretty darn close to film, I love the Acros film simulation, just wonderful. I really liked the image quality of both models. The X100T and soon to be F are classic retro film camera styling. The X-70 is nice too if your on a budget. X-70 and X100T are fixed lens cameras and the X-T2 has a full lens lineup, their primes are outstanding. I wish I never would have touched them because I want one pretty bad.

This guy is straight up and was a hardcore canon user.....


----------



## petrochemist (Jan 11, 2017)

TiCoyote said:


> You can PP a red filter, but it's not quite... the same.


 It's not the same, no it's much better!
With Silver Effects Pro you can easily adjust to just the right amount of red/yellow filtration for the result you want, much better than carrying 4+ filters. If required you can even use different filters for different parts of the image e.g. green for skin tone & red for the sky.

There's so much control available in producing a B&W image from a color file I can't see why anyone would want a B&W only camera. Even with a 720nm IR filter fitted I have useful data in the color channels that can be used to tweak how a B&W image looks.

I use filters quite a lot on my converted camera as they make big differences when IR is included in the mix. I can't see any reason why you couldn't use a red filter on a standard digital camera. You might have to be careful with your metering, but otherwise there shouldn't be any issues.

I suspect removing the Bayer array from a camera will make the file formats difficult to work with, you would need a custom RAW converter...


----------



## john.margetts (Jan 12, 2017)

petrochemist said:


> TiCoyote said:
> 
> 
> > You can PP a red filter, but it's not quite... the same.
> ...


If using Silver Effects Pro software is so much better than using filters, why are you using filters 'quite a lot'?

As for removing the Bayer array, Raw conversion would not be required as the image is not mosaiced - so cannot be demosaiced.


----------



## 480sparky (Jan 12, 2017)

john.margetts said:


> petrochemist said:
> 
> 
> > TiCoyote said:
> ...



So how does a raw converter "know" this? 

How do you _not _demosaic?


----------



## petrochemist (Jan 12, 2017)

john.margetts said:


> If using Silver Effects Pro software is so much better than using filters, why are you using filters 'quite a lot'?.



As I mentioned this is with my IR converted camera. The Bayer filter does not have a separate channel for IR, and IR signals show in all 3 channels. Using a red filter I block visible light that would normally go to the B&G channels just leaving the IR parts in those channels. Software is unable to tell witch bits of the signal are from visible & which from IR so it can't replicate this effect.
Likewise a blue filter will give me mainly Blue, IR & maybe some UV, while blocking R&G. Again the IR shows in all channels.
Another favorite is a U330 filter which is visibly opaque, but transmits UV & IR. this tends to give me nice dark blue skies with blue tinged IR like characteristics. like this:



Dovercourt park IR by Mike Kanssen, on Flickr

Without a filter at all this camera generally produces images which can at first glimpse look normal like this:



Full Spectrum grid by Mike Kanssen, on Flickr
However the teams uniforms match the car (black not brown) to the eye so IR is effecting things. A filter can block the IR to correct that but it's normally much easier to get out my standard camera instead.

If shoot visual B&W I don't use filters other than perhaps a polarizer or ND.

As Sparky points out, the RAW software is expecting to have to demosaic the image & AFAIK has no routines that avoid these calculations in creating the output.
A programmer with the code for RAW conversion ought to be able to strip those routines and change the working/output arrays to the appropriate new resolution. If the code is well annotated it may even be a fairly trivial exercise. Just having the precompiled software would I expect make the job considerably harder.  I suspect the current RAW converter probably uses the separate channels individually for some of noise reduction & sharpening routines as well. If so that may further complicate a Bayer free converter (the custom RAW converter).


----------



## unpopular (Jan 12, 2017)

I think the raw processor would happily demosaic the image as if all three components had the same signal - just as any grey object would. I don't think the raw processor would throw up, but at the same time I don't think you'd get any real advantage either.

Raw Photo processor on Mac can render images in "half" mode, which basically just stacks the array and results in an image of half the pixel size. Results are very, very good, but obviously come at a cost, and the actual impact on resolution is pretty minimal with color rendering and sharpness being most affected. 

I'd imagine though that there must be software out there that will convert a raw file directly to an image file without any processing. I've seen images of what a raw file looks like straight out of the camera, though I don't know how they produced it.

But moreso, is removing the filter even possible? I've always been under the impression that the filter is integrated into the sensor itself, leaving me to question if all they're really doing is some kind of firmware modification to force it into spitting back b/w images. I am not sure if that is even possible or not, though if they will only do this on canon cameras, that should be a good indicator since Canon firmware has already been hacked and is pretty well documented.

I would be pretty skeptical of this service, personally.


----------



## unpopular (Jan 12, 2017)

And yes, there is real advantage to using optical filters, though I don't necessarily believe it's the quality. Rather using them increases exposure rather than pushing channel data - which is already pushed pretty hard in white balance. So assuming you use the same gain on both, you should have less noise liability when using an optical filter.

That said, though, this can be easily overshadowed by the flexibility of using the channel mixer or any other means to get the effect in post.

Certainly, though there are going to be conversion issues when using an optical filter, and simply selecting 'greyscale' on your camera won't necessarily give you the result you're after.


----------



## Ysarex (Jan 12, 2017)

unpopular said:


> I'd imagine though that there must be software out there that will convert a raw file directly to an image file without any processing. I've seen images of what a raw file looks like straight out of the camera, though I don't know how they produced it.



RawDigger and RawTherapee will both allow you to pull the image without demosaicing the CFA. What you can do with it at that point is pretty much restricted to showing off the result for the benefit of instruction. Post processing is needless to say pretty limited.

Here's a B&W photo processed from an *un*demosaiced raw file.






The CFA pattern can't be removed but it can be disguised with a very heavy grain simulation. (I develop my Tri-X in heated Rodinal).

Joe


----------



## unpopular (Jan 12, 2017)

@Ysarex - Interesting.

I am assuming that the pattern is resulting from difference in color across the filtered regions?

Provided that you could compensate for the filter factor of each component, which should be similar, I wonder if you could use the lightness channel to produce an image without the pattern.


----------



## 480sparky (Jan 12, 2017)

Ysarex said:


> ........ RawTherapee will both allow you to pull the image without demosaicing the CFA. ..........



Care to spill the beans on how to do this?  I can't find anything in either V2.4 or 4.1.


----------



## Derrel (Jan 12, 2017)

TiCoyote said:
			
		

> I've been enjoying shooting B&W film, but I wonder if I can get better results with less time/effort/money in digital.  Shooting digital and then converting to B&W has some drawbacks.  You can't use a red filter.  You can PP a red filter, but it's not quite... the same.



Better results? Most likely. Less time? Heck yes, wayyyy less time. Less effort? Oh, my YES, much less effort. The Canon .CR2 files are FULL-COLOR, so you have a full-color, full bit depth .CR2 as well as the camera-created B&W image.

No need to remove the AA filter. I think you want the camera "stock". Set it to shoot RAW + JPEG. Set the color toning as you like: I like Canon's sepia tone look for my RAW + JPEG B&W. Shoot either large, fine JPEGs, or reduced them in size, but keep the fine compression.

You get to PICK Plus OR Minus Development, as needed!!! Soo nice! You can adjust sharpening as-needed. You have* a filter kit,* in button controls! For *EVERY single filter size*! 82,77,72,58,52...you're set on filters!

Set the filter effect to Yellow for a standard, accepted baseline rendering of the large things like blues, greens, reds, and flesh-tones. or, pick another filter, for different looks on the JPG file.

Options of filters are None, Yellow,Orange,Red,Green.

Toning Effect:None,Sepia,Blue,Purple,Green. (I prefer Sepia, but None is also nice: Neutral-tone B&W paper/developer effect.

Set your Parameters Set for the right Contrast, Sharpness, Saturation, and Color one. (Canon''s categories
********
Canon has this ALLLLLLL figured out for you. My ancient POS Canon 20D's images look as good as Plus-X Pan 125, or T-Max 100. Easily as good as 35mm from a what? A 12 year-old mid-priced APS-C sensor camera.
*******

I might be the only person on TPF who advocates this method...you know, actually USING the system those 50 Canon engineers debveloped to shoot perfect SOOC B&W images...with adjustable filter, adjustable contrast levels, adjustable sharpening, adjustable paper/developer toning look,and the right tonal representations that look like file types of filtration.

DOWN-sizing a big image tends to suppress noise' the ancient Nikon D1 made a gorgeous in-camera Medium B&W Jpeg from its noisy  2.7-MP sensor; you're talking Canon 5D II or III--much newer,larger,bigger,better sensor!

You wonder if you can, "can get better results with less time/effort/money in digital".   *Canon developed a system to do just that.*


----------



## Ysarex (Jan 12, 2017)

480sparky said:


> Ysarex said:
> 
> 
> > ........ RawTherapee will both allow you to pull the image without demosaicing the CFA. ..........
> ...



Oops, sorry.

In RT first go to color management and select No profile. You may also want to go down and check Free Gamma and set that to 1.00 and zero the slope. Then go to the Raw tab and under Sensor with _____ matrix select none in the drop box.

Process and you'll get an image with the CFA still in place.

Joe

edit: I'm using version 4.2. Early versions didn't include the none option in that drop list but in that case just close RT, find the .PPx file and open in a text editor. Toward the end of the file you'll see an entry for demosaic = and change what's there to 0. Save the file and then re-open RT, select the image and process without making any other changes.


----------



## Ysarex (Jan 12, 2017)

unpopular said:


> @Ysarex - Interesting.
> 
> I am assuming that the pattern is resulting from difference in color across the filtered regions?
> 
> Provided that you could compensate for the filter factor of each component, which should be similar, I wonder if you could use the lightness channel to produce an image without the pattern.



Yep, that's the pattern source alright and good luck finding a way to remove it. If you do I'd like to know. Here's a dropbox link to that photo above with the CFA fully in place: raw_photo

Joe


----------



## 480sparky (Jan 12, 2017)

Ysarex said:


> 480sparky said:
> 
> 
> > Ysarex said:
> ...



We must have different versions.  I have no "No Profile", for anything, under Color Management (except for monitor profile which is default None).


----------



## Derrel (Jan 12, 2017)

Not sure why anybody would want to debayer a Canon 5D series camera, when there is an entire system in place to supply mostly correct color reproduction, down to the most minute little pixel groupings, and when there is an entire system in place to determine color reproduction based on white balance settings, and when there is an entire system in place to adjust the image in relation to contrast level the photographer uses, a system to adjust the image in relation to the filter effects the system can analyze at breakneck speed, based on the Bayer array's color predictions and the WB, and so on and so on.

Why cripple a system that Canon has built for the entire camera?

PLUS...for the anally retentive, there is ALSO a full bit-depth .CR2 raw file that can be worked to whatever type of B&W image desired, using other types of B&W conversion software, from multiple vendors.

Because of the above basics, it seems to me that de-bayering the camera seems like, well, counterproductive, considering the engineerign sytetem that the Worlds' Number One camera maker has developed over the last almost two decades....


----------



## Ysarex (Jan 12, 2017)

480sparky said:


> Ysarex said:
> 
> 
> > 480sparky said:
> ...








Joe

sorry, not clear enough.


----------



## 480sparky (Jan 12, 2017)

Ah... I was under Preferences.


----------



## john.margetts (Jan 12, 2017)

480sparky said:


> john.margetts said:
> 
> 
> > As for removing the Bayer array, Raw conversion would not be required as the image is not mosaiced - so cannot be demosaiced.
> ...


by not using a Raw converter, perhaps. Or by using a Raw converter that uses dcraw as it's engine (UFRaw, Rawtherapee and several others). Or by using dcraw on its own - it is a command line program so not for the faint hearted - dcraw is quite happy to export the raw file without demosaicing. See the dcraw website for details on how to do this. It involves invoking dcraw with the right toggles/switches.

Sometimes old age and experience of DOS is a useful thing.


----------



## Ysarex (Jan 12, 2017)

unpopular said:


> @Ysarex - Interesting.
> 
> I am assuming that the pattern is resulting from difference in color across the filtered regions?
> 
> Provided that you could compensate for the filter factor of each component, which should be similar, I wonder if you could use the lightness channel to produce an image without the pattern.



This definitely falls under the category of wasting your day doing stupid stuff. My wife tells me just say you're retired. So this is really just a novelty -- I've had recourse to use it in class to show students what demosaicing a CFA is all about so I never poked at it too seriously.

Now I just went back with that photo and made some changes in RT before generating the RGB image. I altered WB and then used RT's channel mixer to equalize the luminance of the red and blue to better match the green. Then I output the undemosaiced file. In PS I selected an area around middle grey and used Hue/Saturation to desaturate all three colors in the CFA and to equalize the tone of each for that middle grey area. I got a lot further in removing the CFA pattern and was able to add much less simulated grain to suppress it. Got better overall tone response as well. Actually not too bad a photo.



 

Joe


----------



## unpopular (Jan 12, 2017)

Yeah I ran into problems essentially trying the same thing, probably got about as close as you did here, but I feel liek I was fighting a gamma adjustment. This should be doable though. And my guess is if I can get things totally linear this shouldn't be too problematic.

I will look into it later.

You might want to take a photo of a grey card, adjust the channels so they all read out middle, and then process the images using that setting. If it does not work and you're getting the pattern in non-grey middle-grey areas a gamma of 1.0 should solve this provided that the adjustment is performed before white balance is. You can reapply gamma using curve adjustment after white balance correction. But once you get the CFA normalized, I don't see any reason why this would not work.

To combine the channels into greyscale, you should be able to stack each of the three channels in Lighten mix mode. That should be the most reliable way to remove the color.


----------



## TiCoyote (Jan 13, 2017)

I could certainly shoot in JPEG monochrome with a filter adjustment, but that wouldn't give me the quality of RAW.  

I use Lightroom for a majority of my editing.  Why wouldn't it be able to import a debayered Raw file?  It is compatible with the Leica Monochrom, and that doesn't have a Bayer array.  

The advantage of debayering a camera is that it effectively splits every pixel into 4 pixels.  You get a 20mpix image with the effective resolution of 80.


----------



## Ysarex (Jan 13, 2017)

TiCoyote said:


> The advantage of debayering a camera is that it effectively splits every pixel into 4 pixels.  You get a 20mpix image with the effective resolution of 80.



No, it doesn't do that. If you pull the Bayer array off a 20 megapixel sensor you still have a 20 megapixel sensor -- there's no resolution increase. A Bayer array does not force 4 pixels into 1 pixel.

Joe


----------



## unpopular (Jan 13, 2017)

TiCoyote said:


> I could certainly shoot in JPEG monochrome with a filter adjustment, but that wouldn't give me the quality of RAW.



Or you could shoot raw and process it into b/w using the white balance controls as your color filter ...



> The advantage of debayering a camera is that it effectively splits every pixel into 4 pixels.  You get a 20mpix image with the effective resolution of 80.



You have a few things incorrect here.

First, LR does not process every camera the same. It may see a monochrome leica file and, if it know what to do with it, does not run the interpolation. However, if it sees a Canon 5D file it will think it's a normal 5D file and run the interpolation. Yes. You'll get a greyscale image, but it would have been interpolated since the raw processor has no idea if it's looked at a debayed sensor, or if it's looking at a scene that has no color in it - does that make sense?

This type of interpolation is kind of a funny thing though. You're taking the RGBG, each having unique spatial data and recombining it into a single domain. Using fancy math I don't totally understand you get more resolution than if you simply stacking the corresponding pixels, averaged their value and removed the empty space (as in RPP's 'half' mode) and then doubled the size. Because the information in each pixel is valid, the raw processor attempts to use adjacent pixels to approximate the full resolution of the image. But it's not perfect, but it is better than simply stacking the pixels.

So yes, You will get substantial increase in resolution, but it won't be a simple 1:1 relationship either.

---

That said, if resolution is what you're interested in, and not sensitivity, then I don't even think it's necessary. I am confident that further development into the techniques discussed above will get you the exact same thing as what you're looking for once the kinks are worked.


----------



## unpopular (Jan 13, 2017)

Ysarex said:


> TiCoyote said:
> 
> 
> > The advantage of debayering a camera is that it effectively splits every pixel into 4 pixels.  You get a 20mpix image with the effective resolution of 80.
> ...



Exactly. The bayer filter is completely passive. Its just an array of colors corresponding to the four channels of a RAW file, RGB+G.

To combine the pixels are interpolated mathematically which while destructive, is not 4:1 destructive.


----------



## Ysarex (Jan 13, 2017)

TiCoyote said:


> I could certainly shoot in JPEG monochrome with a filter adjustment, but that wouldn't give me the quality of RAW.



To answer your original question. Use a digital camera, shoot and process raw files, convert them to B&W and get quality that is superior to shooting film.

Joe


----------



## Ysarex (Jan 13, 2017)

unpopular said:


> Ysarex said:
> 
> 
> > TiCoyote said:
> ...



I would add that since the pixel count stays constant the loss due to interpolation is in fact very minor, basically inconsequential. The AA filter in most cameras does much more to reduce resolution than demosaicing interpolation. That's one of the points behind the Fuji X-Trans sensors and why Fuji developed them.

Joe


----------



## unpopular (Jan 13, 2017)

There are well-known artifacts associated with the Bayer mask and interpolation. I am not sure if "inconsequential" is the right word, and different raw processors do have better results - so interpolation has impacts.

"minimal" perhaps. But "inconsequential" I don't know. And playing with your file here I think there is potential.

I'm also curious how noise would be handled.


----------



## 480sparky (Jan 13, 2017)

Ysarex said:


> TiCoyote said:
> 
> 
> > I could certainly shoot in JPEG monochrome with a filter adjustment, but that wouldn't give me the quality of RAW.
> ...



Only if you're going to compare a DSLR to 35mm SLR film cameras. Let's not forget medium, large and ultra-large format.

I routinely scan 6x7 negs to 45-50mp, and 4x5 at 75mp.  I could scan 4x5 at 1.2gp, but my computer can't handle images that size.


----------



## TiCoyote (Jan 13, 2017)

Thanks for the advice.  I'm going to play around with Silver Efex Pro.


----------



## Ysarex (Jan 13, 2017)

480sparky said:


> Ysarex said:
> 
> 
> > TiCoyote said:
> ...



It's true that you can shoot large film for less money than a large sensor, but large sensors do exist. Another point to consider: resolution is an important image quality consideration but not the most important image quality consideration. When assessing the quality of an image (especially B&W) tone response is quality characteristic #1. The size of film doesn't much matter in that regard.

Joe


----------



## 480sparky (Jan 13, 2017)

Ysarex said:


> It's true that you can shoot large film for less money than a large sensor, but large sensors do exist. Another point to consider: resolution is an important image quality consideration but not the most important image quality consideration. When assessing the quality of an image (especially B&W) tone response is quality characteristic #1. The size of film doesn't much matter in that regard.
> 
> Joe



Are you aware of all the various methods known to alter the 'tone response' of film?  It's far from just adjusting exposure and developing.


----------



## unpopular (Jan 13, 2017)

i do not think we need to make this into a film v. digital discussion. There is a valid discussion about bypassing the bayer mask.

Still, can anyone offer any insight if physically removing the bayer mask is even possible? This seems really implausible.


----------



## 480sparky (Jan 13, 2017)

unpopular said:


> i do not think we need to make this into a film v. digital discussion. There is a valid discussion about bypassing the bayer mask.
> 
> Still, can anyone offer any insight if physically removing the bayer mask is even possible? This seems really implausible.



Not only possible, just Google it.  You'll find plenty of astophotographers doing it DIY, as well as there's companies that offer just that service.  Two being MaxMax and HyperCams and Mods


----------



## Ysarex (Jan 13, 2017)

480sparky said:


> Ysarex said:
> 
> 
> > It's true that you can shoot large film for less money than a large sensor, but large sensors do exist. Another point to consider: resolution is an important image quality consideration but not the most important image quality consideration. When assessing the quality of an image (especially B&W) tone response is quality characteristic #1. The size of film doesn't much matter in that regard.
> ...



Fully.

Joe


----------



## unpopular (Jan 13, 2017)

I've overlooked the obvious here, the exposure after the filter changes depending on the color of the subject and so it is not possible to remove the CFA pattern completely and non-destructively.


----------



## 480sparky (Jan 13, 2017)

unpopular said:


> I've overlooked the obvious here, the exposure after the filter changes depending on the color of the subject and so it is not possible to remove the CFA pattern completely and non-destructively.



When you remove the CFA, there's more light overall striking the sensor.  The exposure system of the camera will be set up to adjust for the presence of the CFA, so my guess will be removing it will cause overexposure.  But that can simply be accounted for by changing Exposure Compensation.  Once you figure out how far to adjust it, just leave it there.

As for not being able to remove it completely, maybe you're seeing all the DIY projects where they want to stay a safe distance from the edge of the sensor since it's really just an IC chip with soldered leads extending out.  Breaking a connection by disturbing those tiny leads would render the sensor useless.


----------



## unpopular (Jan 13, 2017)

@480sparky

I am referring to efforts to counter the CFA pattern in raw processing as discussed above. The issue is that if you have a green part of the frame the green pixels will be brighter than an adjacent area that is more magenta.

Because there is no way to predict what areas will be green or magenta, there is no way to completely remove it.


----------



## 480sparky (Jan 13, 2017)

unpopular said:


> @480sparky
> 
> I am referring to efforts to counter the CFA pattern in raw processing as discussed above. The issue is that if you have a green part of the frame the green pixels will be brighter than an adjacent area that is more magenta.
> 
> Because there is no way to predict what areas will be green or magenta, there is no way to completely remove it.



If you're referring to the pattern caused by not demosaicing, then demosaic and all will be fine.


----------



## unpopular (Jan 13, 2017)

That kind of defeats what we were trying to accomplish.


----------



## Ysarex (Jan 13, 2017)

unpopular said:


> I've overlooked the obvious here, the exposure after the filter changes depending on the color of the subject and so it is not possible to remove the CFA pattern completely and non-destructively.



Yep.

Joe


----------



## 480sparky (Jan 13, 2017)

unpopular said:


> That kind of defeats what we were trying to accomplish.



If the CFA has been removed, the issue of the checkerboard look should be resolved. Every pixel on the sensor should be able to be converted to a single pixel in the image. So you should be able to bypass demosaicing and render the final image as a 1:1 representation of the camera pixels.

At least that's what my aging noodle concludes given my understanding of the process.


----------



## unpopular (Jan 13, 2017)

No, it that makes sense.

What we're talking about are attempts to reverse the CFA pattern on an image taken through a CFA.


----------



## 480sparky (Jan 13, 2017)

unpopular said:


> No, it that makes sense.
> 
> What we're talking about are attempts to reverse the CFA pattern on an image taken through a CFA.



I think one would have to know the demosaic method works and reverse-engineer it from there.


----------



## unpopular (Jan 13, 2017)

The issue is that because we don't know the color of the subject we cannot determine the exposure over each component so there is no way to get a uniform greyscale image. A red subject will have pixels that are white in the red-filtered region, a blue object will have pixels that are white in the blue-filtered region, even if both are reflecting the same amount of energy. That's why you end up with a checkerboard no how you try to process it.

There's just no way to know without looking at the adjacent pixels how the recorded information is representing luminescence or chroma.


----------

