Skip to main content

OpenFilmKit

Free film scanning and negative conversion from the command line, for macOS and Linux, built on SANE.

Status: early development. Capture, conversion and cleanup work; the first scanner it targets is the Plustek OpticFilm 8200i SE. Expect changes.

Install

brew install aidansiegel/openfilmkit/openfilmkit
openfilmkit doctor

The formula builds OpenFilmKit's own SANE runtime (a pinned upstream commit plus the fixes in patches/), kept separate from Homebrew's sane-backends. On Linux, openfilmkit doctor prints the one command that installs the USB permission rule.

pip install "openfilmkit[clean]" installs conversion and cleanup only, on macOS, Linux or Windows. scan needs the SANE runtime that the Homebrew formula builds (or build it yourself from a checkout with tools/build_sane.py); on Windows, scan with SilverFast or VueScan instead (below).

Use

openfilmkit doctor                      # driver, scanner, identification
openfilmkit roll new roll-07 --film color-negative --stock kodak-gold200
openfilmkit scan roll-07 --frames 6     # linear 48-bit TIFF masters, one frame at a time
openfilmkit convert roll-07/masters/frame-01.tif
openfilmkit clean roll-07               # dust and holder edges, on new copies

Every command takes --json. Masters are never changed; every conversion and cleaned copy has a recipe beside it that says exactly how it was made.

  • scan --full-area scans the driver's whole area instead of its default selection.
  • convert picks the film's response curve from openfilmkit stocks / openfilmkit profiles (142 profiles digitized from manufacturers' data sheets).
  • clean removes dust and fibers and trims film-holder edges, always on a new copy. Eyes and mouths, and the camera's date stamp, are left untouched by dust removal; faces are found in any orientation, so sideways frames are covered. Options:
    • --no-dust trims holder edges only; run clean again later for dust.
    • --no-crop keeps the holder edges; --no-faces skips face detection.
    • --color also corrects levels and color cast; --straighten DEGREES, --lift-shadows GAMMA and --red-eye do what they say.
    • --scratches also finds scratches and larger debris with a trained model and fills them with a generative model (see below).
    • On a roll folder, it cleans only conversions without a copy made with the same options.

Scratches

clean --scratches adds a second pass for what dust removal leaves: scratches, fibers and debris. Microsoft's scratch-detection model from "Bringing Old Photos Back to Life" finds them, and MI-GAN, a generative inpainting model, fills them. Faces get a lower threshold and extra speck finders, catchlights and the camera's date stamp are protected, and dark marks are left as scene. Because the fill makes up picture where the damage was, it is off by default and a cleaned copy made with it is recorded as generative processing. --spare-long-lines keeps long straight lines (tile grout, wires) the model can mistake for scratches.

The two models (about 100 MB) are downloaded once, on first use, from this project's models-1 release and checked against their SHA-256; openfilmkit models --fetch gets them ahead of time. Both run in OpenCV. A 33-megapixel scan takes about two minutes and 2.5 GB of memory.

Scans from SilverFast or VueScan

convert also reads the raw scans SilverFast and VueScan save, so a scanner OpenFilmKit can't drive yet, or a Windows PC (where SANE doesn't run), still gets the same conversion and cleanup. Save the scan before any inversion or color correction:

  • SilverFast: save the raw HDR (48-bit) or HDRi (64-bit, with infrared) scan, not a converted positive. Tested with an HDRi scan from SilverFast 9 and an OpticFilm 8200i.
  • VueScan: in the Output tab, save a raw file as 48-bit RGB or 64-bit RGBI (raw files need the Professional edition). Not yet tested with a real VueScan file.

Uncompressed and compressed (LZW, ZIP) files both work. The infrared channel stays in your file but isn't used yet. 8-bit scans are refused, and an already-inverted positive won't convert correctly.

Scanners

openfilmkit scanners lists the film scanners SANE supports and the ones OpenFilmKit has profiles for. A scanner is identified by its driver's internal model ID, confirmed against its USB descriptors, so settings meant for one hardware revision are never used on another.

Data sources

  • Film response curves: digitized from manufacturers' published characteristic-curve charts (Kodak, Fujifilm, Agfa, Konica; most via the 125px film document archive), and from Columbia University's Database of Response Functions (M. D. Grossberg and S. K. Nayar, "Modeling the Space of Camera Response Functions", IEEE PAMI 2004). Each profile records its source, page and SHA-256; see docs/FILM-STOCK-RESEARCH.md and tools/research/datasheets.json. The data sheets themselves are not included.
  • Scratch detection: Microsoft, Bringing Old Photos Back to Life (Wan et al., CVPR 2020), MIT license; the official checkpoint converted to ONNX.
  • Scratch fill: Picsart AI Research, MI-GAN (Sargsyan et al., ICCV 2023), MIT license (code and weights); the generator from the authors' ONNX pipeline. tools/build_models.py rebuilds both model files from the authors' originals.
  • Face detection: YuNet (Shiqi Yu and others), face_detection_yunet_2023mar.onnx from the OpenCV Zoo, MIT license (openfilmkit/data/face_detection_yunet_LICENSE), run through OpenCV.
  • Scanner and model tables: generated from SANE (sane-backends, GPL-2.0-or-later with the SANE exception) at the commit in packaging/sane-pin.json.

License

GPL-3.0-or-later. See LICENSE.

Copyright © 2026 Aidan Siegel <openfilmkit@aidansiegel.com>

Metadata

Release files for openfilmkit 0.3.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 openfilmkit 0.3.0
File Size Uploaded Provenance Actions
openfilmkit-0.3.0.tar.gz 22.9 MB Without provenance Details for openfilmkit-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openfilmkit 0.3.0
File Interpreter ABI Platform Actions
openfilmkit-0.3.0-py3-none-any.whl Python 3 none any Details for openfilmkit-0.3.0-py3-none-any.whl

Total release size: 45.8 MB

Release files / openfilmkit-0.3.0.tar.gz

Download URL openfilmkit-0.3.0.tar.gz
Size 22.9 MB
Tags Source
SHA-256 checksum
How to use checksums
a0f7bcb7d0616df9f33bda3d11dc7177aeed1a0ee6a8ab4380d8e1af325221dd
BLAKE2b-256 checksum
How to use checksums
0cd0346c5ed590e0eb669c5434607ed4f871062f3bf6e17f7de40465041e0674
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / openfilmkit-0.3.0-py3-none-any.whl

Download URL openfilmkit-0.3.0-py3-none-any.whl
Size 22.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
722d39199107f64b4911bfffa44e96589787964f6b3e466e8a44f9fd6d1501e3
BLAKE2b-256 checksum
How to use checksums
f1eff8fc990c84c5fdd905f5062664d177083197aa531ab3aa8ff14dc4f6f7e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Security for openfilmkit 0.3.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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