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

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.2
File Size Uploaded Provenance Actions
minscan-0.1.2.tar.gz 114.8 kB With provenance Details for minscan-0.1.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for minscan 0.1.2
File Actions
minscan-0.1.2-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for minscan-0.1.2-cp314-cp314-win_amd64.whl
minscan-0.1.2-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.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
minscan-0.1.2-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for minscan-0.1.2-cp313-cp313-win_amd64.whl
minscan-0.1.2-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.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Total release size: 382.1 kB

Release files / minscan-0.1.2.tar.gz

Download URL minscan-0.1.2.tar.gz
Size 114.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d528d652005adca7fe60cfa15457395ad9d282732ba41fe82b1dc86f48536ca1
BLAKE2b-256 checksum
How to use checksums
2bf1055b7e2a4161a3cd4938cf423f93dc419b9fac4c6e3f445a28d9da9729dc
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.2-cp314-cp314-win_amd64.whl

Download URL minscan-0.1.2-cp314-cp314-win_amd64.whl
Size 76.8 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
c8733bc1db3db6b4eb6a25ee6a93813c3285e2614832af255b6853ed0f9adda3
BLAKE2b-256 checksum
How to use checksums
d34bc384bc2cc177b9458ce341d285f90df80943725e9b3f80b084821045f45c
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.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL minscan-0.1.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 57.7 kB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3b51d254968bcfc8d13c51be19f2c90ea4c0ce1f6684db52beec4057968f47c7
BLAKE2b-256 checksum
How to use checksums
c233d46243a70704b1b98fe7168307af62e91554a4703e2a722e9071966a84c6
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.2-cp313-cp313-win_amd64.whl

Download URL minscan-0.1.2-cp313-cp313-win_amd64.whl
Size 75.2 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
039cf8591cccfb07cc417726cbbf8a1f68f3d0f6ef066ae7e840f59b97696ece
BLAKE2b-256 checksum
How to use checksums
9c5dec3a16106c336607f0e9a255ed92160306e0fdd1484196c00b053c0536ce
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.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL minscan-0.1.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 57.7 kB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
2a12c0d1b7c5c9c0763876e90861b94b71c35e4d618a6089601f27bbd8a77c6a
BLAKE2b-256 checksum
How to use checksums
1c1e7b3138b6d3ca451d9f404ea7a44c46a53a5d89f50220184f16869dd49761
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.2

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