Skip to content

Repository files navigation

Backflash (local)

A local/offline fork of backflash.pages.dev — a small browser tool that converts Flashback ONE35 raw sensor dumps into a usable image file.

The original site wraps the raw Bayer sensor data in a minimal DNG header with no demosaicing. This version does the same by default, and adds an optional demosaic + color processing step that outputs a viewable RGB TIFF or JPEG instead.

Everything runs 100% locally/offline. No files are uploaded anywhere, no network access is required, no dependencies, no build step — plain JavaScript throughout.

What it actually does

The ONE35 raw file is a fixed-size dump of the sensor's Bayer-pattern pixel data (no general RAW format support — this isn't a CR2/NEF/ARW decoder). The tool:

  1. Detects the sensor version from file size:
    • v1: 2560×1708, 8-bit, BGGR CFA (~4.4 MB)
    • v2: 4144×3088, 10-bit packed, RGGB CFA (~16 MB)
  2. Unpacks the pixel data to 16-bit.
  3. Either:
    • Default: wraps it in a minimal DNG (TIFF) container with the CFA pattern, black/white levels, and camera tags set — still a raw mosaic, meant for import into Lightroom/ Photoshop/other raw-aware software for full processing, or
    • --demosaic / "Demosaic & color process" checkbox: bilinear-debayers the sensor data into RGB, subtracts black level, applies white balance, applies an sRGB gamma curve, and writes an 8-bit RGB image - TIFF (uncompressed) or JPEG, your choice.

Caveat: the embedded ColorMatrix1 is an identity matrix — there's no real per-camera color calibration data available for this sensor, so "color processing" here means white balance + gamma, not a calibrated color-science transform.

JPEG export

--jpg (CLI) / choosing "JPEG" in the format picker (browser/standalone) writes a real baseline JPEG, encoded from scratch in core.js (DCT, quantization, Huffman coding) to keep the project dependency-free, same as the TIFF/DNG/ZIP writers. It doesn't do chroma subsampling (4:4:4, one full-resolution block per component) - simpler to implement and verify than the usual 4:2:0, at the cost of a larger file than an equivalent libjpeg output. --jpg implies --demosaic (a JPEG can't represent an un-demosaiced mosaic); quality is 1-100, default 90 (--jpg-quality / the quality number field next to the format picker).

White balance modes (only apply with demosaicing on)

  • Auto (gray-world, default) — averages the image (excluding near-black/near-blown-out pixels so shadows, highlights, and colored light sources don't skew it as much as a plain mean would) and scales channels so the average comes out neutral gray. Adapts per-photo; this is the one to reach for by default.
  • Camera metadata — uses the DNG AsShotNeutral tag on v2 files (a fixed multiplier baked into the file, the same for every v2 photo regardless of content); a no-op/identity on v1, which has no such metadata.
  • Custom temperature (Kelvin) — pass an exact color temperature (e.g. 3200 for tungsten, 5600 for daylight, 6500 for overcast) and it's converted to gains via a standard blackbody-radiator approximation (Tanner Helland's fit). Also an approximation, same caveat as above — there's no real spectral calibration to convert through.

All three front ends support batch processing — v1 and v2 files can be freely mixed in the same batch, since each file's format is detected independently from its own size. A bad file in a batch is reported as an error without aborting the rest.

Usage

Three interchangeable front ends, all built on the same core.js logic.

1. Standalone HTML (easiest — no server, no install)

Just double-click backflash-standalone.html to open it in your browser. Drag one raw file or many at once onto it, optionally check "Demosaic & color process" (reveals a format picker

  • TIFF / JPEG, with a quality field for JPEG - plus the white balance mode picker: Auto / Camera metadata / Custom temperature). A single file downloads directly; multiple files are bundled into one .zip.

2. Browser UI (served)

index.html + browser.js use an ES module import, which browsers block under file://. Serve the folder over HTTP:

npx serve .
# or
python3 -m http.server

Then open the printed local URL. Same drag-and-drop / batch-to-zip behavior as the standalone version.

3. Command line

Install once, so backflash works from anywhere:

./install.sh

This runs npm link and makes sure the backflash command ends up on your PATH. On Homebrew-installed Node (macOS, both Intel and Apple Silicon), npm's default global-install location is a version-pinned path inside Node's own Cellar folder — not on PATH, and it silently breaks on the next brew upgrade node. The script detects that case and redirects npm's global prefix to a stable ~/.npm-global folder instead, adding it to PATH via your shell's rc file (~/.zshrc or ~/.bash_profile, whichever matches $SHELL). Any other Node setup (nvm, volta, Linux, an already-customized prefix) is left as-is. No sudo. Restart your terminal (or source the rc file it prints) afterward.

Caveat: if you also use nvm, this custom prefix can conflict with it — nvm use will print a warning if it's active. That's an nvm limitation, not a bug here; if you hit it, see nvm's own suggested fix (nvm use --delete-prefix ...).

To remove it: ./uninstall.sh (unlinks the backflash command; leaves the PATH/prefix change in place since other global npm packages may now rely on it too — instructions to fully revert that are printed by the script).

Then:

backflash input.raw                                                    # single file -> raw mosaiced DNG
backflash input.raw --demosaic -o out.tiff                             # single file, demosaiced TIFF, auto WB
backflash input.raw --jpg -o out.jpg                                   # single file, demosaiced JPEG (implies --demosaic)
backflash input.raw --jpg --jpg-quality 80 --white-balance 3200 -o out.jpg  # JPEG, quality 80, tungsten (3200K) WB
backflash input.raw --demosaic --white-balance camera -o out.tiff      # demosaiced TIFF, camera-metadata WB
backflash *.raw --demosaic --out-dir ./converted                       # batch: explicit file list
backflash ./camera-dump --jpg --out-dir ./converted                    # batch: scan a directory, JPEG output
backflash --help

<input...> accepts any mix of files and directories (directories are scanned non-recursively). -o/--output only works for a single input; use --out-dir for batches, which is created if it doesn't exist and defaults to writing each output next to its input. --white-balance only applies with --demosaic/--jpg, and accepts auto (default), camera, or a Kelvin number. --jpg implies --demosaic; --jpg-quality (1-100, default 90) only applies with --jpg.

Without linking, it also runs directly as node cli.mjs ....

No dependencies — just Node.

Files

File Purpose
core.js Format detection, unpacking, TIFF/DNG/JPEG writers, debayer, color processing — environment-agnostic, used by both the browser and CLI
browser.js / index.html / index.css Served browser UI
backflash-standalone.html Single-file version, everything inlined, works from file://
cli.mjs Node CLI
install.sh / uninstall.sh Set up (or remove) the global backflash command
package.json Declares the backflash bin entry used by npm link

License

MIT

About

Local/offline RAW-to-DNG/TIFF converter for Flashback ONE35 sensor dumps, with optional demosaicing and color processing

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages