SANE-less scanner integration #557
Replies: 14 comments 23 replies
|
Rohan is working on something similar using direct-USB acquisition that will be integrated into NegPy |
|
oh nice, a 9000 :) I just walked this road with the LS-5000: tried to land my RE'd driver inside negpy (#497), and marcin's call, which was right, was device code lives in its own package with a python-sane-shaped surface (open / options / scan -> array), negpy consumes it as a thin adapter like python-sane or gphoto2. that became coolscanpy (github.com/rohanpandula/coolscanpy). honest pitch: build the 9000 in there. transports are isolated per device on purpose, the 5000 is just the first entry, and you'd inherit session/reservation logic, receipts, a hardware-free test harness and the pypi plumbing instead of rebuilding them. clean ownership split: you own the 9000 transport/module (I can't even plug firewire in, I won't pretend to maintain it), I own the core and the 5000, and negpy gets one adapter for every coolscan. command grammar should be mostly shared even though the transport differs: frame addressing, exposure vectors, multisample arming chains, IR windows, load/eject. most of that is decoded for the 5000 from wire captures, happy to share notes, might save you real hours. worth watching #556 too, the session/handover seam there (device ownership for a whole batch, one release at the end) is what any external driver needs to coexist with negpy. and your standalone GPU app fits fine on top, lib core + your app is the same split I ended up with. PS we are neighbors, I live in HP! If you ever want to shoot together shoot me a message :) |
|
@activexray I'm currently making some changes in scanner implementation making generic ScannerBackend protocol. Currently i obviously only have SaneBackend talking to it but I want to make it easy to have for example your python-wrapped rust lib or what Rohan is doing pulled as dependency and just plugged in there. I'll probably have it merged to main soon. |
|
I merged my changes to main. SANE-based coolscan support is a bit better + the ScannerBackend is more friendly towards non-sane integrations |
|
Hi all! I am very glad to see this move towards non-SANE implementation because I would love for NegPy to natively scan on Windows as well. To this end, I would like to jump on the reverse engineering bandwagon. I own a Reflecta (Pacific Image) Proscan 10T and I was planning on writing a python bridge shamelessly porting the SANE code. That's why I'm grateful for the work on generic scanner interfacing that Marcin is doing. Will post updates as soon as I have something! |
|
I'll be working on my implementation here for the time being if anyone wants to keep track. I have a private repo with the RE work (it contains a lot of Nikon proprietary binaries so I don't think I can publish it). This public one doesn't do anything yet as I slowly learn how SCSI works and write something I trust. The slopped-together thing in the private repo is really quite bad but does do more. I'm still puzzling over how to reconstruct the image data from the bytes I get back, I can't make a ton of sense of it. |
|
A little update on my Reflecta work: I have a working standalone python script that runs on Windows. I started integrating the command flow into NegPy by making a new backend called pieusb_backend.py, mirroring the sane_backend.py file. Right now, I hard-coded the NegPy interface to use my backend instead of the SANE and to bypass the Windows check, but I think a system to select a backend should be put in place, where I can slot my backend in, maybe with some automatic detection. @marcinz606 any thoughts about this? Additionally, since @activexray is, like me, also working with a SCSI device, perhaps it would be a good idea to extract this to its own module. Though, despite both being SCSI devices, my scanner is USB while the coolscan is Firewire. Unsure what the best strategy is here. My current USB SCSI implementation is rather lean and has no dependencies other than pyusb, so it would be nice to keep it that way. |
|
hi folks doing a bit of a knowledge drop here multisampling isnt an avg (which is what i thought it was)
also the low res prescan is actually super helpful, its whats required for color parity with nikon scan https://github.com/rohanpandula/cool-colors im currently in integration hell, dealing wtih frame offset stuff even with modern CV its all kinds of annoying |
|
Do any of you scanner-driver writing people know if what you get back from your devices in transport are raw brightness units or already gamma-scaled? It seems like the data I get back from the coolscan 9000 is linear so I have to x^2.2 |
|
Is there any way to implement the batch scanning on an RPS 10M? |
|
Yes awesome! How can I help?
…On Tue, Aug 18, 2026, 09:01 Davide Bongiovanni ***@***.***> wrote:
Hi! I'm the one who developed the pieusb python module and integrated it
into NegPy. I would absolutely love to support the RPS 10M in my library.
Unfortunately I don't have the hardware to test the code with. Although if
you're up for it, we may try to find a way to collaborate on this. Once the
functionality is in the library, I will integrate it into NegPy (if batch
scanning already works there, I'm not sure what the state of development is
on that side)
—
Reply to this email directly, view it on GitHub
<#557?email_source=notifications&email_token=B5DPJXI42Z72KT6PIGYJDN35KP5K5A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBQGYYTINBUUZZGKYLTN5XKOY3PNVWWK3TUUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#discussioncomment-18061444>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/B5DPJXNE4JYG7NBIEB6YIRL5KP5K5AVCNFSNUABJKJSXA33TNF2G64TZHMYTCMRTG43DMNRQHE5UI2LTMN2XG43JN5XDWMJQGQ2TKNJVGSQXMAQ>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/B5DPJXJ6IU6SVE5TPBXPQXT5KP5K5A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBQGYYTINBUUZZGKYLTN5XKOY3PNVWWK3TUUVSXMZLOOSVGM33PORSXEX3JN5ZQ>
and Android
<https://github.com/notifications/mobile/android/B5DPJXLK74Y4UZTYLRWKSDD5KP5K5A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBQGYYTINBUUZZGKYLTN5XKOY3PNVWWK3TUUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ>.
Download it today!
You are receiving this because you commented.Message ID:
***@***.***>
|
|
Can't seem to find you. Add me "_eugene9"
…On Tue, 18 Aug 2026 at 18:51, Davide Bongiovanni ***@***.***> wrote:
Hop on the Discord, we can plan there without spamming here. My display
name is the same as my github username
—
Reply to this email directly, view it on GitHub
<#557?email_source=notifications&email_token=B5DPJXITH67QAVBHN5RRDZT5KSCQZA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBQGY4TCMJTUZZGKYLTN5XKOY3PNVWWK3TUUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#discussioncomment-18069113>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/B5DPJXILKJ3NFWWGDD7OYJT5KSCQZAVCNFSNUABJKJSXA33TNF2G64TZHMYTCMRTG43DMNRQHE5UI2LTMN2XG43JN5XDWMJQGQ2TKNJVGSQXMAQ>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/B5DPJXNXPCXZ7T3AMKW4CJT5KSCQZA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBQGY4TCMJTUZZGKYLTN5XKOY3PNVWWK3TUUVSXMZLOOSVGM33PORSXEX3JN5ZQ>
and Android
<https://github.com/notifications/mobile/android/B5DPJXK7QGZS5AQ47CNNL735KSCQZA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBQGY4TCMJTUZZGKYLTN5XKOY3PNVWWK3TUUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ>.
Download it today!
You are receiving this because you commented.Message ID:
***@***.***>
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hey! So following up on the other discussion of scanner support in NegPy:
I've been working on my own reverse-engineering of the SCSI driver for the Coolscan 9000 I have. I'm sick of having to boot up my windows VM with a dedicated FireWire card to scan just to bring them back into linux to invert. I know I could use Nikon's conversion but I used to use NLP and now I've been trying NegPy to get away from windows + lightroom.
I'm a decent way through the RE, I've got thumbnail scanning working and have a pretty big chunk of the API surface covered. My initial plan was to write my own standalone scanner program with GPU-accelerated renders for these massive medium format scans, exposing all the bells and whistles for the scanner that SANE does not support (it technically doesn't even support the 9000, only the 8000).
It would not be that hard to modularize what I do into a library that then you can call from somewhere else such as NegPy. I see there is already
ScannerService, so I guess I would implement that? Once I flesh out all the details I'm sure there will be more discussion over how to expose features.All reactions