Open source · Rust · WebAssembly

Camera RAW,
decoded in a flash.

FlashRaw is a fast, memory-safe decoder for ~40 camera RAW formats, from Rust, C, C++, Python, the GPU, or this page. Open a file: it is decoded here, in WebAssembly, and never leaves your device.

Drop a RAW file anywhere on this pageOpen a RAW file from your device

Nothing is uploaded. The decoder (≈620 KiB) loads when you open a file. The sample is a 7.6 MB C-RAW CR3 from a Canon EOS R5 Mark II, from raw.pixls.us (CC0).

CR3 CR2 NEF ARW RAF DNG ORF RW2 PEF SRW IIQ 3FR X3F and ~25 more

  • ~40RAW formats, every make and model on raw.pixls.us
  • 1,980 / 2,016raw.pixls.us files decode, with pinned output hashes
  • 8–15×faster than LibRaw from RAW to display RGB
  • 620 KiBof WebAssembly (brotli) for all of it, in the browser

Why FlashRaw

One decoder for every camera, built to be fast on every core and safe on every file.

Speed

  • Every decoder is multithreaded, even single-stream codecs (lossless JPEG, Nikon, Pentax, Hasselblad, Panasonic v8, Sony ARW1), by speculative parallel decoding
  • Explicit SIMD: SSE4.1, AVX2, AVX-512, NEON and WASM SIMD128, picked at run time
  • Fused single-pass RAW → RGB on the CPU or the GPU
  • Region and tile decodes, zero-copy embedded previews

Security

  • Memory-safe Rust: parsers of untrusted files cannot overflow buffers or use freed memory
  • Bounds-checked parsing, checked offset arithmetic, IFD loop and depth tracking
  • Allocation limits checked before allocating
  • 10 fuzz targets on every PR and nightly; an explicit truncation policy, never silent garbage

Support

  • ~40 RAW formats, every make and model on raw.pixls.us: 1,980 of 2,016 files decode, with pinned output hashes
  • CR3 incl. C-RAW, JPEG XL DNG, lossy and deflate DNG, GoPro GPR, Sigma X3F, Fuji compressed, Panasonic v4–v8, IIQ, 3FR/FFF
  • 1,000+ models in the built-in camera database

Bindings

Rust, C, C++, Python (NumPy, zero-copy, GIL released) and JavaScript/TypeScript, plus a compatibility C API for porting existing RAW code.

GPU

Unpack, demosaic, white balance and colour as WGSL compute shaders: Metal, Vulkan, DX12 and WebGPU. Results can stay on the GPU.

Browser

One npm package for browsers, Web Workers, Node.js and Deno. WASM SIMD, multithreaded when cross-origin isolated, optional WebGPU.

Benchmarks

Same files, same machine, each library built for speed (LibRaw with OpenMP, RawSpeed with OpenMP and -march=native), all cores. Medians of per-file speedups over 62 popular cameras.

Loading benchmark charts…

Full method, per-camera and per-format numbers, and the cases where FlashRaw is not the fastest: docs/benchmarks.md.

Feature comparison

Checked against LibRaw 0.22.0 and RawSpeed (develop, c835b05) sources and builds.

FeatureFlashRawLibRaw 0.22RawSpeed
LanguageRustC++C++
Memory-safe parsing of untrusted filesYesNoNo
LicenseMIT / Apache-2.0LGPL-2.1 / CDDL-1.0LGPL-2.1
Benchmark set: 159 files, every format and codec159156126
Canon CR3 (incl. C-RAW)YesYesNo
Fujifilm lossy compressed RAFYesYesNo
JPEG XL DNG (DNG 1.7)YesAdobe DNG SDK build onlyNo
Lossy (JPEG) DNGBuilt inNeeds libjpegNeeds libjpeg
GoPro GPR (VC-5)YesGPR SDK build onlyYes
Sigma X3FYesYesNo
DNG opcode listsAll radiometric opcodes, per stageAdobe DNG SDK build onlyStage 1 subset
RAW → RGB pipelineBilinear, half-size (CPU or GPU)Many demosaicsRaw data only
Multithreaded decodingEvery codec3 codecs (OpenMP build)Tiled/sliced codecs (OpenMP)
Explicit SIMD kernelsSSE4.1/AVX2/AVX-512, NEON, WASMNoOne SSE2 routine
GPU accelerationMetal, Vulkan, DX12, WebGPUNoNo
Browser / WebAssembly packageOfficial npm packageThird-party portsNo
Region and tile decodingYesNoNo
Zero-copy embedded previewsYesCopiedNo previews
Continuous fuzzingIn-tree, every PROSS-FuzzIn-tree
C / C++ APIflashraw.h / flashraw.hppYesC++ only
Pythonpip install flashraw (NumPy, zero-copy)Third-party (rawpy)No
RustNativeThird-party bindingsNo
LibRaw-compatible C APISubset (recompile and relink)–No

“Benchmark set” counts the files each library decoded in our runs, with LibRaw and RawSpeed built without optional SDKs (libjpeg, Adobe DNG SDK, GPR SDK). Nikon High Efficiency (TicoRAW) is a proprietary codec that no open decoder supports.

Install

The same decoder, from every language.

npm install flashraw
import { FlashRaw } from 'flashraw';

const raw = await FlashRaw.open(file);          // File, Blob, ArrayBuffer, Uint8Array
console.log(raw.metadata.camera.name, raw.metadata.exposure.iso);

const preview = await raw.preview();            // embedded JPEG, no decoding
const img = await raw.decode({ output: 'rgba8' });
ctx.putImageData(img.toImageData(), 0, 0);
raw.close();

Browsers, Web Workers, Node.js ≥ 18 and Deno. Vite, webpack, Rollup and esbuild. npm README · WASM internals