Using A Laser To Blast Away A Bayer Array

A Bayer array, or Bayer filter, is what lets a digital camera take color photos. It’s an array of tiny color filters that sit on top of a camera’s CCD. The filter makes it so that each sub-pixel in the image sensor only sees red, green, or blue light. The Bayer filter is an elegant tool that gives us color digital photos, but what would you do if you wanted to remove one?

[Les Wright] has devised a way to remove the Bayer filter from the Raspberry Pi Camera. Along with filtering red, green, and blue light for their respective sensors, Bayer filters also greatly reduce the amount of UV and IR light that make it to the CCD sensor. [Les] uses the Raspberry Pi camera in his Pi-based Spectrometer, and he wants to remove the Bayer filter to improve and expand its sensitivity.

Of course, [Les] isn’t the first one to want to do this. Some have succeeded in physically scratching the filter off of the CCD, but because the Pi Camera has vital circuitry around the outside of the sensor, scratching the filter off would likely destroy the circuitry. Others have stripped it off using chemical means, so [Les] gave this a go and destroyed no small number of cameras in his attempt to strip the filter off with solvents like DMSO, brake fluid, and industrial paint stripper.

A look at the CCD, halfway through the process.

Inspired by techniques used in industry, [Les] eventually tried to use a several-kW nitrogen laser to burn off the filter (which seems appropriate given his experience with lasers). He built a rig that raster scans the laser across the sensor using stepper motors to drive micrometer bases. A USB microscope was included to allow progress to be monitored, and you can see a change in the sensor’s appearance as the filter is removed.

After blasting off the Bayer filter, [Les] plugged his improved camera into his home-built spectrometer and pointed it outside. The new camera gives the spectrometer much more uniform sensitivity and allows [Les] to see further into the IR and UV bands. The spectrometer can even detect the Fraunhofer lines—subtle dips in the sun’s spectrum from absorption by molecules in the atmosphere.

This is incredible for a DIY setup and instrument, and we can’t wait to see what [Les] does next to improve his measurements. If your spectrometry needs are more mass than visual, take a look at this home-built mass spectrometer. Home spectrometers aren’t just for examining light spectra—they can also be used to judge the ripeness of fruit!

47 thoughts on “Using A Laser To Blast Away A Bayer Array

  1. Perhaps something similar could be viable with a USB webcam or even the camera on a mobile phone. Perhaps a lower powered laser, say 1W or so, could be used if it was focused enough. Maybe even selectively removing just one colour from the mask. Effectively having a reasonable compromise.
    It’s easy enough to remove the IR filter from the lens assembly of most cameras, allowing you to see a little way into the IR and UV range, transparent coca-cola etc., but removing the bayer layer array seems like it could open up new possibilities, perhaps even chemical analysis. Something for a future tricorder project.

    1. Most all of those sensors are basically identical to the pi cameras in operational method and construction (it is just a normal phone camera module on a breakout board to mate it to a pi), so should be at least a similar process to make it work.

      As for what lasing power would really be needed I have no idea at all, I assume the paper he showed would have some details on that (I didn’t catch it in the video if mentioned) but I haven’t even considered reading it yet. In theory with tight enough focus any laser could be powerful enough, but for practicality you want a big enough functional spot size that your x-y table can move reliably some fraction of that spot size – otherwise you are just going to be removing some small scattered dots/lines, and you don’t want it to take 6 months.

      I can’t see how it would be possible to really remove just one colour without harming the rest of the filter, or really why you would want to. Perhaps removing all but one colour – use a well matched wavelength to the colour you want to survive for the laser and the other colours should cook much more impressively than the colour you wish to keep… But I’m far from certain, at least at this hour of the morning on no sleep (6 am and can’t manage to stay asleep right now – stupid headcold), what the result would be on the rest of the sensor – its possible you would burn out the sensor beneath the surviving filter colour, it could work fine, or the construction method would mean the whole lot blows off anyway – I think the latter two are most likely, but I know I’m neither a real expert on this process nor awake enough to really be thinking clearly…

    2. you need proper ablation to blast the filter clean off, you can’t just melt it. This needs power, a lot of it. The pulse can be very short, so average power is not high, but you need the peak pulse power in the kW.
      Depending on the absorbtion, maybe a small laser engraver could work. Can be had for $2-3k direct from China and has more uses…if you can find one with a borked galvo head but working laser, you could rebuild it for much less.

        1. There is a bayer removal service that already exists but it’s quite pricy, they say they get perfect results every time so I think they’re using chemicals (piranha solution or other etchant).

    1. I was looking for one for a similar spectral playing project a while ago, they do exist, but damn are they pricey (at least all the ones I found were), if you can even get them to respond with a price to an individual… You would think just not bothering to apply the filter layer wouldn’t cost extra, well I suppose it might not, as the only places I found that offered such cameras offered them with all the lab certification type details that adds cost, and in higher frame-rate than a pi cam, probably more pixels, certainly a larger sensor area – can’t really remember all the details it was a while ago…

      That said making them this way to me is quite awesome, know its possible in theory, but to see it done, and do so well with such basic equipment (yes I’m envious I don’t have said equipment – but its still pretty basic stuff of its sort).

  2. So in a display there are red, green, and blue sub-pixels, though in a CCD or even CMOS imaging sensors, the Bayer filter filters the light for the whole pixel. Those sensors don’t have sub-pixels. Using various interpolation algorithms gives an RGB image.

    1. Sensor is a bit small for astronomy. But it’s pretty similar size wise to what we were using 20 years ago at the budget end, with a higher resolution.

      Can Les do it to a Hasselblad medium format? Now that would be good for astronomy!

      1. Its pretty close to what they are putting into those really expensive fully automated scopes. No eyepiece and you view though your iphone. They get great reviews on cloudynights, though all the reviewers only have one post and that was the review. Hmmm….

  3. At least one comment here about BW cameras. The hacker is obviously pretty clever, so there must be a reason he *didn’t* use a BW camera. I would love to know what that reason is?

    (unless he just did it for fun – which is a perfectly valid excuse!)

    1. Try buying a B&W camera. They are expensive as they are mostly used for scientific applications which normally have bigger budgets. One question for the author… do the individual R G G B pixels have descreat coordinates from the singular RGB pixel? In other words. Does this give you a true higher resolution or is it just greater sensitivity?

      1. ASI178MM costs 300 bucks, which isn’t very expensive for a camera. Admittedly still lot more expensive than picam2 but not thousands of dollars like some more serious cameras.

  4. I would love to have a camera with one of each two green filters removes, thus giving a

    RGRGRG
    BWBWBW

    pattern. That would allow to do interesting things, like true chroma with UV or IR, with “per pixel” transparency, and no motion blur problems, like the ones that plague the current “green/blue chroma” techniques. Some kind of “digital sodium vapor process”.

  5. Is the image being captured raw, or is the software still trying to de-mosaic the image?
    How does the Pi handle calibration and image quality settings for the camera? Can these be bypassed? Is it possible to create custom settings to help account for new lenses and the removal of the Bayer filter?

    1. Yeah, the software is still trying to de-bayer. It is now basically now acting like a monochrome sensor that is binning the 4 sensor sites. Kinda. Im not sure if there is a way to get raw pixel data out of it.

      1. I should have googled it. The Pi foundation allowed raw access back in 2015 and people have been messing with de-bayered cameras since before that.

        The most interesting recent thing is that they have moved to using libcamera and via the v4l2 framework, it looks like it’s possible for the community to write new camera drivers and ISP controls. It will be interesting to see what the community does with that access.

  6. I have used a cold plasma torch ie (HF plasma) anda slow flow of O2 in a sealed chamber the plasma generates ozone had has uv light which destroys the bayer filter and does not damage the CMOS sensor. It takes about 10-12 minutes to remove the filter the process gas is pulled from the chamber and goes through a activate charcoal filter which is in front of the vacuum pump. This process also leaves no residue on the sensor surface and eliminates the computerize X,Y,Z stage.
    Cheers,
    Steve

  7. A exremely interesting article.
    But why does he pronounce Either (eng: EI-ther “Z” eng Zed in the Amrican way.? He is British or is the engliah language now a subset of American?

    1. Just popped it off with a scalpel.
      Yes, but they are north of $500 bucks! I already had the N2 Laser and perhaps spent >$300 USD on the project, I have learned things, and I can now have as many monochrome cams as I want! ;-)

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.