Skip to main content

Interface and acquire images from the Reflecta (a.k.a PacificImage) line of film scanners.

Project description

pieusb

Python package to enable interfacing with USB-connected Reflecta (a.k.a. PacificImage) film and dia scanners.

Prerequisites

Windows

You need to swap whatever driver Windows auto-assigned to your scanner to WinUSB

Linux

You need to add a udev rule

sudo tee /etc/udev/rules.d/60-pieusb.rules >/dev/null <<'EOF'
SUBSYSTEM=="usb", ATTR{idVendor}=="05e3", ATTR{idProduct}=="0142", TAG+="uaccess"
SUBSYSTEM=="usb", ATTR{idVendor}=="05e3", ATTR{idProduct}=="0144", TAG+="uaccess"
SUBSYSTEM=="usb", ATTR{idVendor}=="05e3", ATTR{idProduct}=="0145", TAG+="uaccess"
EOF
sudo udevadm control --reload-rules && sudo udevadm trigger

If you only care about operating one scanner, you can skip the lines with irrelevant ATTR{idProduct}. Here is a summary of which scanners have which

Model ATTR{idProduct}
DigitDia 6000 Multiple Slide Scanner 0142
CrystalScan 7200 0145
ProScan 7200 0145
ProScan 10T 0145
CrystalScan 3600 0145
DigitDia 4000 0142
RPS 10M (aka Pacific Image PrimeFilm XAs) 0144

macOS

It should just work™

Install

pip install pieusb

Usage example

import pieusb
from pieusb.types import ScanPhase

for info in pieusb.available_devices():
    print(info.vendor, info.model)

scanner = pieusb.Scanner(pieusb.available_devices()[0])
scanner.mode = "rgbi"
scanner.resolution = 5000
scanner.color_depth = 16
scanner.tl_x, scanner.tl_y = 0, 0
scanner.br_x, scanner.br_y = 14200, 9600

def on_progress(data):
    if data.phase == ScanPhase.SCANNING:
        print(f"{data.scanned_lines}/{data.total_lines}")

def on_complete(result):
    if result.error:
        raise result.error
    numpy.save("scan.npy", result.image)

scanner.scan(progress=on_progress, scan_complete=on_complete)   # returns immediately
scanner.wait()                                                  # optional
scanner.close()

WARNING

No guarantees are made as far as hardware safety goes.

It may be possible to set certain parameters, such as scan width or height, such that the physical limits of the scanner are exceeded. This may damage your hardware.

Proceed at your own risk.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pieusb-0.2.0.tar.gz (48.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pieusb-0.2.0-py3-none-any.whl (39.1 kB view details)

Uploaded Python 3

File details

Details for the file pieusb-0.2.0.tar.gz.

File metadata

  • Download URL: pieusb-0.2.0.tar.gz
  • Upload date:
  • Size: 48.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for pieusb-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e1427061e648ab4fa4695edcb368185fbf0f42f6af2de4d97e46b1e4fd542e45
MD5 c2bcf9db93c2bee8fc0abbc55d77ef1b
BLAKE2b-256 9382304cf642c52036c175956bc5200575502326c4577ec194915addc491f714

See more details on using hashes here.

Provenance

The following attestation bundles were made for pieusb-0.2.0.tar.gz:

Publisher: publish.yml on davide-b/pieusb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pieusb-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pieusb-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 39.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for pieusb-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 924877549b704c1dae1f15249eb238b19876b4e39fed5c754f599a1634b13005
MD5 20c3183db57ccb7f3f03849eab6df163
BLAKE2b-256 813f779deeb48275b8e4a9bcfca53ca04e595775babfb06b913d17d981f6f817

See more details on using hashes here.

Provenance

The following attestation bundles were made for pieusb-0.2.0-py3-none-any.whl:

Publisher: publish.yml on davide-b/pieusb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page