Skip to main content

minscan

a clean C23 userland driver for Minolta DiMAGE film scanners. created with a lot of reverse engineering and a few evenings of protocol analysis. this tool supports all scanner features that DiMAGE Scan exposes.

currently only supports the DiMAGE SCAN Multi PRO (AF-5000), as that's the unit I have. I suspect that all scanners use more or less the same protocol. the tool needs a bit of rework in order to add multi-scanner support, that's on the to-do list.

minscan supports Linux and Windows. Apple ditched Firewire support in macOS so there's no support builtin for now. for Windows you will need a driver, see misc/minolta.inf, that should be sufficient.

notes

ice is LLM-ported from nkscan (give me a break, I suck at math), currently singlethreaded, and slow as balls (think ~30 secs for a 6x9 frame). I wrote the frame layout with SIMD in mind as well so let's see how much speed I can push out of this thing. for now, negpy's IR routines are way better than what I cooked up so if you care about quality give that a shot.

build

meson setup build
ninja -C build
meson test -C build --print-errorlogs

debug with sanitizers:

meson setup build-asan -Db_sanitize=address,undefined -Dbuildtype=debug
ninja -C build-asan
meson test -C build-asan

usage

make sure you have the sg module loaded into your kernel first. --device is optional: without it minscan looks for the Minolta scanner itself (/sys/class/scsi_generic on Linux, the SCSI port driver on Windows). for a regular scan of a 6x9 color negative, IR channel in the 4th layer, using the HA-P1 glass holder:

./minscan scan -s 6x9 --filmtype colorneg --dpi 3200 --focus auto --rgbi output.tiff

pass -d /dev/sg1 (or -d '\\.\Scanner0' on Windows) to select a device explicitly.

minscan help
  focus      focus sweep
  scan       acquire a frame
  eject      eject carrier
  help       output usage information
  probe      probe the scanner
minscan scan --help
scan: acquire a frame
Usage:
  minscan  [-h|--help] [-d|--device=<device>] [-p|--prescan] -s|--size=<6x45|6x6|6x7|6x8|6x9|35mm> [-g|--glassless] -r|--dpi=<dpi> [-e|-v|--exposure_value=<-2.5...2.5>] [-f|--focus=<-250...250|auto>] [--frame=<frame>] --filmtype=<colorneg|colorpos|bw> [--ir] [--ice] [--rgbi] [--calibrate] [--verbose] <file>
 
Available options:
  -h, --help                               show this help
  -d, --device=<device>                    SCSI device (default: autodetect)
  -p, --prescan                            grab a low-res prescan instead of a full scan
  -s, --size=<6x45|6x6|6x7|6x8|6x9|35mm>   film size (carrier is autodetected)
  -g, --glassless                          use the HA-P2 insert instead of HA-P1 (120 only)
  -r, --dpi=<dpi>                          DPI for scan (must divide 4800 for 35mm or 3200 for 120)
  -e, -v, --exposure_value=<-2.5...2.5>    exposure compensation (stops). defaults to 0
  -f, --focus=<-250...250|auto>            auto to perform autofocus, or a manual value. defaults to stored device value
  --frame=<frame>                          frame to scan (35mm: 1..6, 120: 1; default 1)
  --filmtype=<colorneg|colorpos|bw>        film type (changes exposure curves)
  --ir                                     acquire IR; write a separate _IR TIFF (also with --rgbi)
  --ice                                    run ICE dust/scratch removal. acquires IR; the IR plane is written only with --ir or --rgbi
  --rgbi                                   write one 64-bit RGBI TIFF (acquires IR; sidecar only with --ir)
  --calibrate                              force refresh the scanner's dark/light calibration data
  --verbose                                show info log lines (ICE rebuild stats, row counts)
  <file>                                   output file

IR/ICE output combinations:

--ir                RGB + _IR sidecar
--rgbi              4-channel RGBI
--ir --rgbi         RGBI + _IR sidecar
--ice               RGB (IR discarded after ICE)
--ir --ice          RGB + _IR sidecar
--rgbi --ice        RGBI (ICE applied to the RGB planes; IR kept as channel 4)

layout

include/minscan/    internal interfaces
src/core/           portable protocol/descriptor/session/image code
src/platform/       platform-specific abstractions
src/transport/      OS-specific SCSI passthrough backends
tests/              golden CDB/page/descriptor tests

contributing

yes, please! do mark your PRs as AI-generated if they are, though; I'm not against LLM use, I used my fair share of them to simplify the RE and wire analysis as well as the math (and I haven't written a test since 2024 or so :D) but I like to know who (or in this case, what) created the code I'm looking at.

other projects you may like

  • nkscan - the one that finally got me to pull the trigger on this project to get rid of Windows once and for all, and the source of the ICE implementation used in minscan

Metadata

Release files for minscan 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for minscan 0.1.1
File Size Uploaded Provenance Actions
minscan-0.1.1.tar.gz 114.3 kB With provenance Details for minscan-0.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for minscan 0.1.1
File Actions
minscan-0.1.1-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for minscan-0.1.1-cp314-cp314-win_amd64.whl
minscan-0.1.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for minscan-0.1.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
minscan-0.1.1-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for minscan-0.1.1-cp313-cp313-win_amd64.whl
minscan-0.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for minscan-0.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Total release size: 381.0 kB

Release files / minscan-0.1.1.tar.gz

Download URL minscan-0.1.1.tar.gz
Size 114.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ecdfe38d7cc14b5bb6bde462a6c87ab0303c15061fe983a17683d71bd2bc21f8
BLAKE2b-256 checksum
How to use checksums
5e50dd6e0218aa3058c6890648e925b3d9050ea73f85de9ef1b9c5d19d657229
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / minscan-0.1.1-cp314-cp314-win_amd64.whl

Download URL minscan-0.1.1-cp314-cp314-win_amd64.whl
Size 76.6 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
f9afd41bdd1f936e86cf54619475abc75fb690b9542aa964070354e92f53f20f
BLAKE2b-256 checksum
How to use checksums
74bb4fb27d879ef4568213fa84f82c6f7f9a734f71bd8c72667dcaeb283cc279
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / minscan-0.1.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL minscan-0.1.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 57.6 kB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
eab3eaf6dc9842f5eb411bb220b30e2f54597ab480ff5e0039ca29e02098ae2e
BLAKE2b-256 checksum
How to use checksums
383fe3f205e6c7e28d14c71b2e53a270ec7e05ac7e97ea9dd9dc1d6a71d19ba3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / minscan-0.1.1-cp313-cp313-win_amd64.whl

Download URL minscan-0.1.1-cp313-cp313-win_amd64.whl
Size 75.0 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
52c2898af32602b3fe0039f955fda5730570e0d389715049a39779da32c23471
BLAKE2b-256 checksum
How to use checksums
35831bb4ba094f4a36d4c49e365f602418f4ae8022f990b2b6d53b4001052110
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / minscan-0.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL minscan-0.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 57.6 kB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
7c4f5454eea744f5504ad42b1d42cc9c135a56709d6aa2e56c522b003bfc70fa
BLAKE2b-256 checksum
How to use checksums
3cd99ee71ecea0a50f3781d094ba53122dbbdc33381ef27531829230441433fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Security for minscan 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for minscan-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page