Skip to content
cfelicioPublic

About

Local-first 16-bit film scan processor for Nikon Coolscan (.NEF), Epson flatbeds, VueScan & SilverFast. Auto-crops borders, splits film strips, fixes orientation & reads quartz date stamps with optional local Qwen3-VL AI, and exports 16-bit ICC TIFFs + sRGB viewing copies.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ScanSieve

CI Release License: AGPL-3.0-or-later Python 3.13+

Open-source, local-first, 16-bit archival processor for digitized analog film scans.

Alpha Software Notice: ScanSieve is early alpha software provided "as is" without warranty of any kind. Features, file layouts, and database schemas may change between releases. Use at your own risk, test on copies of your files first, and always keep independent backups of your original scans.

Built for Nikon Coolscan (LS-4000 / LS-5000 / LS-8000 / LS-9000 .NEF & .TIFF), Epson Perfection flatbeds (V600 / V700 / V800 / V850), VueScan, and SilverFast workflows. ScanSieve automates border cropping, deskew straightening, multi-frame strip splitting, B&W and C-41 color negative inversion, upright rotation and quartz camera date-stamp OCR via optional local Vision AI (llama.cpp + Qwen3-VL / Qwen2.5-VL), interactive before/after review, and parallel resumable export of lossless 16-bit ICC archival TIFF masters plus sRGB viewing copies for Immich, Lightroom, DigiKam, or PhotoPrism.

Screenshot 2026-11-27 083700

Portable Download (No Python Required)

Prebuilt standalone bundles for Windows (x64), macOS (Apple Silicon arm64), and Linux (x64) are published on the GitHub Releases page:

  1. Download the archive for your OS (ScanSieve-portable-windows-x64.zip, ScanSieve-portable-macos-arm64.tar.gz, or ScanSieve-portable-linux-x64.tar.gz).
  2. Extract it anywhere portable and run ScanSieve.exe (Windows) or ./ScanSieve (macOS / Linux).
  3. All catalog state, thumbnails, logs, and optional AI runtime weights live inside the adjacent data/ directory.

Key Features

  • Non-Destructive Source Handling: ScanSieve is designed to treat your original .NEF / .TIFF scan files as read-only rather than modifying, renaming, moving, or deleting them. Unmounted or offline drives mark catalog records offline instead of purging edits.
  • 16-Bit Processing End-to-End: Pixel geometry (crop, deskew, rotation), negative inversion (Dmin film-base normalization), and tonal adjustments run in float32 [0.0, 1.0] derived from native uint16 and write back to uint16 16-bit TIFFs.
  • Nikon Coolscan .NEF SubIFD + Root-IFD Inheritance: Enumerates root pages and SubIFDs, selects the largest full-resolution 16-bit plane, strips extra infrared (RGBI) channels for processing, and inherits root-IFD ICC profiles (e.g. Nikon Adobe RGB 4.0.0.3000), scanner tags, DPI, and normalized dot-delimited timestamps (2015.08.05 19.40.44).
  • LittleCMS2 Color Management: Browser previews, VLM inputs, and viewing copies (JPEG, AVIF, WebP) convert from the source ICC profile to sRGB via Pillow.ImageCms; 16-bit archival TIFF masters retain the original embedded ICC profile bytes.
  • Shared Render Engine (WYSIWYG): The web UI's live Before/After slider and the 16-bit archival exporter invoke the same apply_recipe pipeline.
  • 1:N Virtual Frame Model: One flatbed strip scan maps to N independent virtual frames with separate crop boxes, deskew angles, orientations, tonal recipes, and dates.
  • Loopback-Only Web UI: Pure Python stdlib ThreadingHTTPServer bound to 127.0.0.1 with Host-header validation and zero Node.js build dependencies.
  • Staged & Resumable Exports: Output files are written to sibling temp files before being renamed into place. Interrupted or partially failed export runs can be retried (--retry <run_id>) without re-exporting completed frames.

Supported Scanners & Formats

Scanner / Software Format Full-Res Plane ICC & Metadata Handling
Nikon Coolscan / Nikon Scan 4.x .NEF, .TIFF 16-bit RGB/RGBI inside SubIFD Inherits Nikon Adobe RGB 4.0.0.3000, Make, Model, Software, DPI, and dot-format DateTime from Page 0
Epson V600 / V850 / Epson Scan .TIFF 16-bit RGB on Page 0 (single or multi-frame strip) Splits multi-frame 35mm / 120 film strips into N virtual frames
VueScan / SilverFast .TIFF 16-bit / 8-bit RGB or RGBI Slices 4th IR channel; preserves embedded ICC & DPI

Hardware Acceleration Matrix (Local AI Runtime)

ScanSieve's optional Vision-Language Model runtime (llama.cpp llama-server + quantized Qwen3-VL / Qwen2.5-VL GGUF) is downloaded on demand into data/runtime/ with SHA256 verification (no PyTorch required).

Platform Arch Backends Notes
Windows x64 cuda, vulkan, cpu Auto-detects NVIDIA (nvidia-smi), Vulkan GPUs, or CPU fallback
Linux x64 cuda, vulkan, cpu Auto-detects NVIDIA CUDA, Vulkan, or CPU fallback
macOS arm64 metal Native Apple Silicon Metal acceleration
Any Any External OpenAI-compatible API / --no-ai Point to an existing endpoint (--endpoint) or disable AI completely (--no-ai)

Quickstart

1. Create Local Virtual Environment (Python 3.13+ / 3.14)

Windows (PowerShell):

python -m venv .venv
.venv\Scripts\python.exe -m pip install -e ".[test]"

macOS / Linux:

python3 -m venv .venv
.venv/bin/python -m pip install -e ".[test]"

(Optional) Install ExifTool on PATH for broader Lightroom / Immich / DigiKam metadata compatibility. When exiftool is absent, ScanSieve falls back to its built-in pure-Python TIFF ExifIFD / Pillow EXIF + XMP writer.

2. Launch the Web Review UI

Use the portable launcher scripts:

  • Windows: run.bat
  • macOS / Linux: ./run.sh

Or run directly from the CLI:

scansieve serve --open

3. CLI Pipeline Workflow

# 1. Inspect a single Nikon Coolscan .NEF or Epson .TIFF
scansieve inspect "D:\Scans\Roll01\scan_001.nef"

# 2. Scan a folder into data/catalog.db and generate sRGB previews + 16-bit working proxies
scansieve scan "D:\Scans\Roll01"

# 3. Run border crop, deskew, multi-frame strip splitting, B&W & uninverted-negative detection
scansieve analyze-geometry

# 4. (Optional) Download local VLM runtime and detect upright orientation + quartz date stamps
scansieve ai download --backend auto --model default
scansieve analyze-ai

# 5. Open the interactive darkroom review UI on [http://127.0.0.1:8420](http://127.0.0.1:8420)
scansieve serve --open

# 6. Export 16-bit Adobe Deflate TIFF masters + sRGB JPEG viewing copies (preserves input folder structure by default)
scansieve export --out "D:\ArchiveExport" --scope approved --compression deflate --folder-mode preserve

If an export is interrupted or some items fail (e.g. an offline source drive), resume or retry only the failed items:

scansieve export --retry 1

Web Review UI Highlights

Darkroom-neutral #141414 local browser interface (127.0.0.1:8420) with responsive scaling across 1080p, 1440p, and 4K displays:

  • Contact Sheet View: Lazy-loaded grid with smart filters (Needs Review, Multi-Frame, Uninverted, B&W, Undated, Ambiguous Dates, Approved), folder tree, Analyze Geometry & Analyze AI top-bar actions, first-run AI Setup Wizard, and floating batch bar.
  • Inspector & Before/After Slider: Real-time split-screen comparison driven by the 16-bit working proxy and shared pipeline.py engine, interactive multi-frame crop/deskew overlay with configurable Aspect Ratio Lock (Keep Ratio, Freeform, 3:2, 6:7, 1:1, etc.), and manual date/roll propagation.
  • Export Drawer: Scope defaulting to Approved only, output folder organization (Preserve input folder structure by default, Preserve + Year/Month inside folders, Global Year/Year-Month, or Custom), native folder picker with + New Folder, 16-bit TIFF master compression (adobe_deflate, zstd, lzw, none), sRGB viewing format (jpeg, avif, webp), sample path preview, and per-run failure retry.

Architecture Overview

scansieve/
├── AGENTS.md                  # Engineering invariants & catalog schema reference
├── pyproject.toml             # setuptools packaging & dependencies
├── run.bat / run.sh           # Portable cross-platform launchers
├── docs/api.md                # Local REST API reference
├── src/scansieve/
│   ├── cli.py                 # Typer CLI commands
│   ├── config.py              # Portable data/ paths & worker defaults
│   ├── db/                    # WAL-mode SQLite 1:N catalog & non-destructive scanner
│   ├── imaging/               # Agnostic SubIFD loader, LittleCMS2 color, geometry, pipeline
│   ├── ai/                    # Pinned llama.cpp runtime manager & structured VLM analyzer
│   ├── export/                # Profiles, EXIF/TIFF/XMP provenance, 16-bit writer, parallel runner
│   └── web/                   # Loopback ThreadingHTTPServer, REST router & Vanilla JS/Canvas UI
└── tests/                     # Synthetic SubIFD NEF, multi-frame, AI mock, server & export tests

Development & Verification

# Run full test suite
.venv\Scripts\python.exe -m pytest -q

# Run linter
.venv\Scripts\python.exe -m ruff check src tests

License & Third-Party Notices

ScanSieve is licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later). See LICENSE.

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of merchantability or fitness for a particular purpose.

For licenses covering bundled Python libraries and optional on-demand AI runtime/model downloads, see THIRD_PARTY_LICENSES.md.

About

Local-first 16-bit film scan processor for Nikon Coolscan (.NEF), Epson flatbeds, VueScan & SilverFast. Auto-crops borders, splits film strips, fixes orientation & reads quartz date stamps with optional local Qwen3-VL AI, and exports 16-bit ICC TIFFs + sRGB viewing copies.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages