Open source · Rust · WebAssembly

8.8–15× faster than LibRaw RAW → RGB · median

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

Your file never leaves your device. The decoder (≈750 KiB) loads in the background as soon as the page appears. 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; 1,980 of the 2,016 raw.pixls.us samples decode
  • 8.8–15×faster than LibRaw from RAW to display RGB
  • 750 KiBof WebAssembly (brotli) for all of it, in the browser

Why FlashRaw

One decoder for the cameras people shoot, built to be fast on every core and safe on hostile files.

Speed

  • Every decoder is multithreaded, even single-stream codecs (lossless JPEG, Nikon, Pentax, Hasselblad, Panasonic v8, Sony ARW1), by speculative parallel decoding
  • Explicit SIMD kernels: SSSE3/SSE4.1 on x86-64, NEON on Arm and WASM SIMD128
  • 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
  • 15 fuzz targets in the repository, run locally; an explicit truncation policy, never silent garbage

Support

  • ~40 RAW formats, checked against pinned output hashes. Of the 2,016 files in the raw.pixls.us corpus, 1,980 decode; the other 36 are formats not supported yet or not RAW files, mainly 28 Nikon High Efficiency NEF
  • 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
  • Colour management: sRGB, Display P3, Adobe RGB, ProPhoto or Rec. 2020 output with embedded ICC profiles, or any ICC profile you supply

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
ICC colour managementP3, Adobe RGB, ProPhoto, Rec. 2020, any ICC profileNeeds a Little CMS buildNo
Multithreaded decodingEvery codec3 codecs (OpenMP build)Tiled/sliced codecs (OpenMP)
Explicit SIMD kernelsSSSE3/SSE4.1, NEON, WASM SIMD128NoOne SSE2 routine
GPU accelerationMetal, Vulkan, DX12, WebGPUNoNo
Browser / WebAssembly packageOfficial npm packageThird-party portsNo
Region and tile decodingYesNoNo
Zero-copy embedded previewsYesCopiedNo previews
Fuzz targetsIn-tree (cargo-fuzz)OSS-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