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.0

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.0
File Size Uploaded Provenance Actions
minscan-0.1.0.tar.gz 113.3 kB With provenance Details for minscan-0.1.0.tar.gz

Built distributions (wheels)

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

Total release size: 228.4 kB

Release files / minscan-0.1.0.tar.gz

Download URL minscan-0.1.0.tar.gz
Size 113.3 kB
Tags Source
SHA-256 checksum
How to use checksums
74932db91e814ff8ccb6a6c7e32203e77c6afc454602f40d6df1de81f0cc9c51
BLAKE2b-256 checksum
How to use checksums
01f68e7c040997a6849fe6269a6e8fb1684a55193007419e71d3db771f8d5b6b
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.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL minscan-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 57.5 kB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
8c354426e351e44fb66a437f8faf3b46ae9998ec4be5acd818fcf20bf2f2cfeb
BLAKE2b-256 checksum
How to use checksums
8457f091bb567c868ad1f0953af134c3dc1f24a954cd36d58da6c6d6676eaa76
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.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL minscan-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 57.5 kB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c0c400639fbff4d7eaa14688795c7fb0b2ad9b9e0bb2e48bd531f53acf38860e
BLAKE2b-256 checksum
How to use checksums
26a2bcadb0e7430e61f3fe31911be6506e5a0dd5aa15b9793a06024e034ecad5
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.0

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 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for minscan-0.1.0.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