Engineering notes on decoding RAW photos in the browser
By Matthieu Audo, Montreal. November 25, 2026.
Most browser-based RAW viewers only extract the embedded JPEG preview stored inside a camera file, or upload the RAW file to a remote server for conversion. Building Rawnd meant solving three practical constraints directly inside a browser tab: decoding sensor data in WebAssembly, reading multi-gigabyte shoot folders without duplicating them in memory, and writing XMP sidecars that Adobe Lightroom actually reads cleanly.
1. Bayer 2x2 vs Fujifilm X-Trans 6x6 demosaicing in WebAssembly
Standard cameras from Canon, Nikon, Sony, and Olympus use a 2x2 Bayer color filter array.
Most Fujifilm X-series bodies (X-T, X-Pro, X-H, X-E, X-S) use an irregular 6x6 X-Trans
pattern instead. A decoder can parse an .RAF container without error and still
produce broken output if it hands those photosites to a Bayer demosaicing pass.
In Rawnd, the Rust decoder compiled to WebAssembly (around 4 MB for
rawnd_raw_bg.wasm, built on rawler) applies white balance to the
mosaic before demosaicing, anchors green interpolation on each photosite's own reading,
interpolates color differences rather than nearest neighbors across edges, neutralizes
clipped highlights so bright skies do not turn green, and runs a two-pass chroma median
filter to suppress false color artifacts.
2. Why folder access behaves differently on Chrome, Firefox, and Safari
Culling a wedding or event shoot means opening hundreds of files at once, not picking one
image at a time. Chromium browsers expose showDirectoryPicker(), which returns
a FileSystemDirectoryHandle. That handle is only a few bytes, can be stored in
IndexedDB, and lets the editor reopen the same shoot folder after a page reload.
Firefox and Safari do not support persistent directory handles. Using an HTML
webkitdirectory input to pass a 500-photo shoot from a landing page to an
editor via IndexedDB forces the browser to enumerate and copy tens of gigabytes of file
objects before the first frame even appears. On those browsers, Rawnd skips the handoff and
lets photographers drop a folder directly into the editor so files are read in place.
3. What belongs in an XMP sidecar, and what is intentionally left out
An XMP sidecar next to a RAW file lets photographers do a fast first culling pass in the browser and still finish the final edit in Adobe Lightroom, Camera Raw, or Bridge. Pick and reject flags, star ratings, and core exposure and tone adjustments map cleanly into standard XMP fields.
Some controls are intentionally omitted from the sidecar export. White balance in a browser offset slider does not map cleanly to Camera Raw's absolute Kelvin temperature and tint scale, and features like custom tone curves, HSL panels, local masks, vignette, and defringing would produce misleading results if approximated. Exporting only fields with a reliable mapping avoids corrupting a catalog on import.
4. Keeping every photo local
All 16 supported formats (CR2, CR3, CRW, NEF, NRW, ARW, SRF, SR2, RAF, DNG, RW2, ORF, PEF, SRW, IIQ, and generic RAW) decode locally on the user's machine. Even the optional assisted culling pass downloads its face-detection model once and runs locally in the browser. A free account stores only an email address, and no photograph is uploaded to a server.