B.S.
B.S.

Reputation: 63

Python driver for film scanner reflecta rps?

anyone experience with custom drivers for reflecta film scanners? I want a very basic python script to directly control a Reflecta RPS 10m film scanner via USB. I just need to start a scan with a certain dpi and the output stream. Any starting points or hints?

I found the SANE project, but I'm not experienced enough to draw out the information how to control a scanner via the usb interface directly by python.

Upvotes: 2

Views: 115

Answers (1)

Mark Setchell
Mark Setchell

Reputation: 207798

Here is how I got 2 different scanners working under macOS. It was maybe 2 years ago, and I don't have access to a scanner similar to yours...

So, as Apple doesn't see fit to provide a software package manager, I needed to install homebrew first. Then install the SANE stuff:

brew install libusb
brew install sane-backends

Then find the scanner:

sane-find-scanner
found USB scanner (vendor=0x04b8 [EPSON], product=0x012a [EPSON Scanner]) at libusb:253:005

You want the last word on the above line, I used this to find an EPSON scanner:

device=$(sane-find-scanner | awk '/EPSON/{print $NF}')
echo $device
libusb:253:005

Now you can scan full-page, high-resolution, in colour with:

scanimage --device epson:$device --mode color --resolution 300 --format=tiff > scan.tif

Then I modify the image with ImageMagick because I am faster with that than working out the correct scanner commands! So, if I wanted a lower-resolution, greyscale version of the scanned TIFF file from above, I might use:

brew install imagemagick

magick scan.tif -colorspace gray -resize 50% SmallGrey.jpg

If you get stuck with the commands, I found a good way to debug is with:

SANE_DEBUG_SNAPSCAN=128 scanimage -L

I have found a £30 Raspberry Pi to be even better at recognising scanners so I often use one of them too. The procedure is pretty similar.

Upvotes: 3

Related Questions