Built-in camera scanning for NegPy — narrowband-RGB + white-light capture #429
Replies: 4 comments 1 reply
-
|
Hell yes! this is awesome, if it ends up getting merged into negpy, ill archive my own version as this is superior in every way! Thanks for making/sharing this @light-sntchr |
Beta Was this translation helpful? Give feedback.
-
|
amazing! I actually wanted to look into it sometime in the future but you beat me to it! |
Beta Was this translation helpful? Give feedback.
-
|
Please open a PR once you are happy with it, hopefully we can extend it to support more camera brands with some crowdsourcing in the future |
Beta Was this translation helpful? Give feedback.
-
|
After some googling i think that maybe using would allow for FOSS camera support across many manufacturers |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Marcin, and everyone 👋
First: thank you for NegPy. I scan film at home and it's become the heart of my workflow, the RGB Scan trichromatic merge especially is something I couldn't find anywhere else.
I'd like to float an idea before writing any code at you: a camera-scanning workflow built directly into NegPy, so you can capture a negative with a camera + an RGB light source and go straight to a finished positive — capture, merge, invert, finish — all in one app.
Full transparency up front: I'm not a professional developer. I "vibe-coded" the whole thing with Claude, as someone who just wanted this to exist. I'm saying that on purpose, because I think it's actually a point in its favour here — more on that below.
Why this fits NegPy specifically
NegPy already has the clever half. In #288, @rohanpandula proposed the RGB separation mode and you built the sub-pixel-aligned RGB Scan merge (
features/rgbscan) from his sample files. What NegPy still doesn't have is the capture half — so today you shoot the three exposures in some other app and bring the folder in afterwards.This proposal closes that gap: a capture layer that produces exactly the R/G/B triplets your merge already expects, plus a normal white-light mode, without touching the merge or inversion pipeline at all.
Narrowband RGB is worth the three shots, incidentally: a single broadband exposure lets the dye layers contaminate each other, and the green Bayer filter — the broadest — picks up leakage from the red and blue light at once. One LED at a time removes that crosstalk by construction, and each channel gets the sensor's full dynamic range instead of sharing it (the approach in the Flückiger et al. film-scanning research).
What it does
What you'd need — and what you wouldn't
pyserial; no new heavy dependencies.Under the hood — kept deliberately clean
Because it was AI-assisted, I worked hard to keep it aligned with how NegPy is actually built, rather than bolting on a mess:
features/rgbscan. The whole feature touches just three of your existing source files (controller.py,right_panel.py,pyproject.toml) — plus an architecture section inCLAUDE.mdand a newdocs/CAMERA_SCANNING.md. Everything else is new, self-contained modules. (pyserialis the one new dependency, and I'm happy to make it an optional extra if you'd rather.)sony-capturehelper, which runs as its own process and talks to NegPy over a plain stdin/stdout line protocol. No proprietary code ever enters the NegPy binary, and every user supplies their own copy of the SDK.make all-clean, and it's rebased onto the official 0.35.0.Testing and maintenance
In #288 you mentioned you don't have a scanning setup like this, and I realise that's a fair reason to hesitate over hardware code you can't run yourself. So, concretely:
And practically: I can send you sample R/G/B triplets and record a short screen capture of a full calibrate-and-scan, so you can see the whole loop working without owning a rig — the same way the merge got built.
Credit — and a question for @rohanpandula
A lot of the capture foundation comes from @rohanpandula's TriRGB project (https://github.com/rohanpandula/TriRGB, MIT): in particular the
sony-capturehelper and the R/G/B sequencing + exposure-calibration approach, which I built on and adapted to fit NegPy. My additions to the helper (host-side capture inside a live-view session, per-camera focus-magnifier ratios, multi-camera support, a cross-platform build) live on a branch of a fork.@rohanpandula — I hope that's OK with you! I'd love your blessing to propose this here, and I'm happy to credit it however you'd prefer, or to send the helper changes back your way if you want them. Thanks too to jackw01 for the open-source Scanlight hardware.
Have a look
It's all pushed and ready to browse — no pull request, nothing landing in your inbox, just code you can look at whenever you feel like it:
0.35.0: https://github.com/light-sntchr/NegPy/tree/camera-scanningmain: main...light-sntchr:NegPy:camera-scanningdocs/CAMERA_SCANNING.mdsony-capturehelper: https://github.com/light-sntchr/TriRGB/tree/sony-capture-negpyThe ask
Is a built-in camera-scanning workflow something you'd want in official NegPy?
If it is, I'll happily open a proper PR, record a demo, or reshape it to fit your plans — including keeping it optional/opt-in if you'd rather the core stay lean. If it's out of scope for where you're taking NegPy, that's completely fair too — either way, thank you for building such a clean codebase that a non-dev could extend it this far.
Thanks for reading! 🙏
Beta Was this translation helpful? Give feedback.
All reactions