LightCraft: Rebuilding the RAW Photo Pipeline in Pure Rust
Digital photography workflows have drifted into bloated subscription silos and brittle legacy toolchains. Photographers and engineers who want full ownership over their raw negatives face a recurring dilemma: pay continuous rent for closed desktop suites or fight with decades-old C codebases that struggle on modern operating systems. LightCraft approaches raw development from an infrastructure angle by writing a non-destructive image engine in pure Rust with native Model Context Protocol support.
Problem
Processing camera RAW files requires precision math, heavy memory bandwidth, and strict non-destructive state management. Modern high-resolution sensors produce 45 to 100 megapixel Bayer or X-Trans files that demand real-time demosaicing, tone mapping, and color grading across high-dynamic-range scenes.
The standard industry tools solve this by consuming gigabytes of system memory and enforcing vendor lock-in. Adobe Lightroom stores edits in proprietary catalog databases that tie catalog histories to cloud subscriptions. If your subscription lapses, your development modules lock up. Meanwhile, cloud-tethered editors offload metadata to remote endpoints, introducing privacy concerns for sensitive production shoots and air-gapped field operations.
On the local machine, the developer experience is equally frustrating. Commercial RAW processors offer zero programmatic access. Automating a batch exposure correction or querying image parameters requires fragile desktop GUI automation scripts or cumbersome export watch folders. You cannot pipe a catalog state into a command-line tool, nor can you safely integrate modern local inference agents into your retouching workflow without running into sandboxing blocks.
Existing solutions
Open-source alternatives like Darktable and RawTherapee have sustained independent photographers for years. They provide accurate color pipelines and support broad lens calibration profiles through Lensfun. However, their internal architectures carry decades of technical baggage.
Darktable is written predominantly in C and C++, depending heavily on Gtk3 and complex OpenCL configurations. Build times are long, cross-platform distribution across macOS and Windows often suffers from UI rendering quirks, and memory safety bugs still surface in edge-case file formats. Extending these suites requires compiling native C modules or writing Lua scripts that lack modern asynchronous primitives.
Legacy image processors treat raw editing as an isolated GUI session rather than an inspectable, reproducible data pipeline.
Python-based batch pipelines such as RawPy (built on LibRaw) provide scripting capabilities, but they fail to deliver real-time interactive feedback. Wrapping C bindings introduces foreign-function overhead and thread-safety limits under sustained multi-core workloads. Photographers are left choosing between a monolithic GUI app with no API or a headless script without interactive visualization.
Future with AI
LightCraft rethinks the raw processing engine from scratch. Written in pure Rust, it compiles down to native binaries on Linux, macOS, and Windows, while also compiling to WebAssembly for browser targets. It replaces bloated UI frameworks with a lightweight rendering loop and enforces thread safety at compile time.
Instead of hiding development operations behind opaque binary files, LightCraft models edits as monotone parametric curves and deterministic operation trees. Every adjustment, from exposure offsets to dark-channel dehaze, executes in memory without touching source pixels.
Crucially, LightCraft ships with an embedded Model Context Protocol (MCP) server. This design turns the darkroom into an addressable service for AI agents. An autonomous agent running locally can inspect the color histogram, apply parametric grading, and generate side-by-side verification renders through standard JSON-RPC calls over standard input/output.
# Run the LightCraft engine headlessly via MCP
cargo run --release --bin lightcraft-server -- --mcp-stdio
# Query image state from an autonomous agent
{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "adjust_exposure", "arguments": {"exposure": 0.75, "highlights": -20}}}
Integrating Segment Anything Model 3 (SAM 3) directly into the masking engine allows local semantic selection of skies, subjects, and luminance bands without sending customer assets over the network. By pairing memory-safe Rust routines with agentic protocols, image processing shifts from manual slider dragging to scriptable, auditable workstation infrastructure.