flashraw 0.1.1

Extremely fast, safe RAW image decoding: DNG, CR2, CR3, NEF, ARW, RAF, RW2, ORF, PEF and more
Documentation

flashraw

FlashRaw is a fast, memory-safe camera RAW decoder written in Rust, with Rust, C, C++, Python and JavaScript (WebAssembly) bindings. It decodes about 40 RAW formats (CR2, CR3, NEF, ARW, RAF, DNG, RW2, ORF, PEF and more) with SIMD kernels, multithreading and an optional GPU backend, converts to display-ready RGB with ICC colour management, and runs in the browser.

Official website and live demo: flashraw.ybouane.com (it decodes your file locally in the browser) · Source on GitHub · Follow @ybouane on X

Fast, safe camera RAW decoding in Rust: DNG, CR2, CR3, NEF, ARW, RAF, RW2, ORF, PEF and more, with bounds-checked parsing, configurable Limits for untrusted files, multithreaded CPU decoding, an optional GPU backend and the same API compiled to WebAssembly, Python and C.

[dependencies]
flashraw = "0.1"
use flashraw::{DecodeOptions, FlashRaw, OutputFormat};

fn main() -> flashraw::Result<()> {
    let raw = FlashRaw::open_path("photo.CR3")?;                 // headers only, memory-mapped
    println!("{} {}x{}", raw.metadata().camera(), raw.metadata().width, raw.metadata().height);
    let frame = raw.decode(DecodeOptions { output: OutputFormat::Rgba8, ..Default::default() })?;
    println!("{} bytes of RGBA8", frame.as_u8().map_or(0, |d| d.len()));
    Ok(())
}

Of the 2,016 files in the raw.pixls.us corpus, 1,980 decode (98.2%); the other 36 are valid files in formats that are not supported yet (28 Nikon High Efficiency NEF, Light L16, Casio CAM, JPEG-in-DNG), see docs/formats.md.

Built with FlashRaw

  • LightFlow: professional photo correction and colour grading, running locally in your browser with WebGPU.
  • ImageFlow: a Photoshop-class image editor in your browser.

Official website: flashraw.ybouane.com · Created by @ybouane · Licence: MIT OR Apache-2.0