Skip to main content

OpenFilmKit: film spilling out of an open box

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). --tiff writes a 16-bit TIFF at full resolution instead of a JPEG (see below).
  • clean removes dust and fibers and trims film-holder edges, always on a new copy. Eyes and mouths, and the camera's date stamp (bright or printed faintly, upright or down the side), 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 second model (see below).
    • --spot X,Y[,R] fills a spot that's left, from its surroundings like a dust fill: X,Y are pixels in a copy cleaned with the same options (the crop comes out the same), R a radius (default 0.4 % of the short side). Repeat it for more spots; the recipe lists them.
    • On a roll folder, it cleans only conversions without a copy made with the same options.

Files you get

File From What it is
Master scan Linear 48-bit TIFF straight from the scanner, never changed.
Processed master convert --tiff, then clean 16-bit TIFF, sRGB with the profile embedded, lossless compression, full resolution. The file to edit, archive or upload (Immich takes it as the original).
Viewing copy convert, then clean 8-bit JPEG for sharing and web pages; clean can also make one from a processed master (--output frame.jpg).

clean works on a 16-bit TIFF at full depth: it makes every decision on an 8-bit copy, exactly as for a JPEG, and applies color, cropping, straightening, shadows and dust fills at 16 bits, so smooth skies and shadows keep tens of thousands of levels instead of 256. The processed master is sRGB for now: until the scanner is profiled (M4 in the roadmap), conversion assumes sRGB primaries, so a wider color space would hold no extra color.

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, an inpainting model, fills them in from what surrounds 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. Only the damaged spots are filled, typically about 1 % of a scan; the rest of the photo is untouched. Because a model draws what goes into those spots, the pass is off by default, and the recipe says which model filled how many pixels and what share of the picture that is. --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 73-megapixel scan, 16-bit included, takes about five minutes and at most 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 network 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.
  • Test photos: Sally K. Ride (NASA S84-37256, 1984) and Grace M. Hopper (U.S. Navy NH 96919-KN, 1984), both public domain, and real dust from a scan of blank film (CC0); the tests check that clean leaves an undamaged portrait alone and finds real and added damage. Sources in tests/fixtures/README.md.
  • 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.5.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.5.0
File Size Uploaded Provenance Actions
openfilmkit-0.5.0.tar.gz 23.4 MB Without provenance Details for openfilmkit-0.5.0.tar.gz

Built distribution (wheel)

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

Total release size: 46.3 MB

Release files / openfilmkit-0.5.0.tar.gz

Download URL openfilmkit-0.5.0.tar.gz
Size 23.4 MB
Tags Source
SHA-256 checksum
How to use checksums
b68b5e156da6ba0fd058c7526475f4658bfdcd5c8ec2a91998570fc3f0b3d04a
BLAKE2b-256 checksum
How to use checksums
56743054273f9bcd6f1f4da74531056f5b57191eb593d2d11ba34b91b5243ab5
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.5.0-py3-none-any.whl

Download URL openfilmkit-0.5.0-py3-none-any.whl
Size 22.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
23ea8fd7317a0f2cd27906d37be0715bb31261bdff08d2b6576daa294fee99a3
BLAKE2b-256 checksum
How to use checksums
edb266f9991e5bc4479e58b0286cafda2523b1155ff9ed0f9f004a23d21149a3
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.5.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