rawroom
by lostsh
README.md
# rawroom
<p align="center"><img src="docs/assets/hero.svg" alt="rawroom: 1.3–1.9× faster RAW to JPEG than the next-fastest tool (rawpy), 5 ms RAW metadata, 129 ms RAW preview, 20 photos reviewed in one contact sheet" width="100%"></p>
**A fast, offline photo editor built for AI agents.** Point it at a camera raw
file or a JPEG, give it a recipe, and get the edited picture back, one photo or
a thousand. One static binary, pure Go, no dependencies, no network.
rawroom was called pixclia up to v0.1.3; the old npm package and MCP Registry
entry point here.
```sh
curl -fsSL https://raw.githubusercontent.com/lostsh/rawroom/main/install.sh | sh
rawroom info IMG.CR3 --json # metadata in milliseconds, no pixel decode
rawroom analyze IMG.CR3 --json # exposure, clipping, colour cast, noise, hints
rawroom auto IMG.CR3 --look natural -o r.json # solve a recipe toward a look
rawroom edit IMG.CR3 -o out.jpg --recipe r.json --resize 2048
rawroom batch --recipe r.json --out-dir out/ shoot/*.ARW
rawroom contact out/*.jpg -o sheet.jpg # one image to review the whole batch
```
Or run it as an MCP server so Claude (or any MCP client) gets editing tools
directly: `claude mcp add rawroom -- npx -y rawroom mcp`.
**If you are an AI agent, read [AGENTS.md](AGENTS.md).** It is the operating
manual: install, the common workflows, the recipe format and the
parameter ranges. A ready-made Claude Code skill is in
[`skills/rawroom/`](skills/rawroom/SKILL.md).
## Install
| | |
|---|---|
| Linux, macOS, FreeBSD | `curl -fsSL https://raw.githubusercontent.com/lostsh/rawroom/main/install.sh \| sh` |
| Windows (PowerShell) | `irm https://raw.githubusercontent.com/lostsh/rawroom/main/install.ps1 \| iex` |
| Any OS with Node 18+ | `npx -y rawroom ...` (downloads the matching binary once) |
| Go 1.27+ | `go install github.com/lostsh/rawroom@latest` |
| Binaries | [GitHub releases](https://github.com/lostsh/rawroom/releases) (checksums in `checksums.txt`) |
The installers check the download against the release checksums. Set
`RAWROOM_VERSION=v0.1.0` to pin a version, or `RAWROOM_INSTALL_DIR` to choose
where the binary goes.
**For AI agents:**
| | |
|---|---|
| Claude Code plugin (MCP server + skill) | `/plugin install rawroom --marketplace lostsh/rawroom` |
| Claude Code, MCP server only | `claude mcp add rawroom -- npx -y rawroom mcp` |
| Any MCP client | `{"mcpServers": {"rawroom": {"command": "npx", "args": ["-y", "rawroom", "mcp"]}}}` |
| MCP Registry | `io.github.lostsh/rawroom` |
| Agent Skill | [`skills/rawroom/SKILL.md`](skills/rawroom/SKILL.md) |
| Docs index for LLMs | [`llms.txt`](llms.txt) |
To make your agents reach for rawroom in your own projects, add this line to
the project's `CLAUDE.md` or `AGENTS.md`:
```markdown
For any photo task (RAW or JPEG editing, colour grading, resizing, batch edits, contact sheets), use rawroom: run `npx -y rawroom --help`, or read https://raw.githubusercontent.com/lostsh/rawroom/main/AGENTS.md
```
## Why
AI agents are often asked to "fix the exposure on these 200 photos" or "give
this shoot a film look". The existing tools are built for people: GUI-first,
slow to start, configured through sidecar files, with output an agent has to
parse. rawroom is built for programs:
* **Machine interface.** Every command has `--json` with stable keys,
structured errors (`{"error":{"code","message","hint"}}`) and documented exit
codes. `rawroom schema` emits the JSON Schema of recipes and parameters.
* **Decide without looking.** `analyze` reports the numbers an agent needs
(EV against mid-grey, clipping, cast, saturation, noise, sharpness, skin) and
hints that name the parameter to change. `auto` solves exposure, white
balance and the black and white points toward a look.
* **Review cheaply.** `preview` renders a small result in a fraction of a
second (DCT-domain JPEG scaling, half-size raw demosaic, or the camera's
embedded preview). `contact` puts a whole batch on one labelled sheet, so a
vision model can review 30 pictures in one image.
* **Reproducible.** A recipe is one JSON file (parameters, geometry, raw
options, LUT/preset, output). The same recipe always gives the same pixels.
* **Fast.** Every stage is parallel: raw decoding, demosaicing, rendering,
JPEG decoding and encoding. See [Benchmark](#benchmark).
## Built for agents
An agent cannot squint at a slider. It needs numbers to decide, one cheap look
to confirm, and a way to apply the same decision to a thousand files. Every
rawroom command is one step of that loop, with JSON in and JSON out.
<p align="center"><img src="docs/assets/agent-loop.svg" alt="The agent loop: info 4.8 ms, analyze 0.43 s, auto 2.7 s, preview 0.13 s, edit 1.1 s per RAW or 4.3 s per 20 JPEGs, contact sheet 0.98 s for 20; then fix the recipe and re-run" width="100%"></p>
Tokens are an agent's real budget. `analyze` turns a photo into about 500
tokens of measurements, and `contact` turns 20 results into one image an
agent can check in a single look:
<p align="center"><img src="docs/assets/agent-tokens.svg" alt="Estimated tokens: analyze JSON about 526, one preview about 934, a 20-photo contact sheet about 2,356, twenty separate previews about 18,680" width="88%"></p>
What each tool gives an AI agent out of the box (as benchmarked; "—" means
not available without writing your own glue):
| | rawroom | darktable-cli | RawTherapee-cli | ImageMagick | libvips | LibRaw | rawpy |
|---|---|---|---|---|---|---|---|
| Structured output (JSON) for every command | **yes** | — | — | `identify` only (`json:`) | — | — | Python objects |
| Machine-readable errors and exit codes | **yes** | — | — | — | — | — | Python exceptions |
| MCP server (tools for Claude and other clients) | **built in** | — | — | — | — | — | — |
| Measurements to decide an edit (exposure, cast, clipping, noise) | **`analyze`, with hints** | — | — | `identify -verbose` stats | `stats` | — | — |
| Solve settings toward a target look | **`auto`** | GUI only | GUI only | — | — | — | — |
| One review image for a batch | **`contact`** | — | — | `montage` | `arrayjoin` | — | — |
| Edit as one replayable JSON recipe | **yes** | XMP sidecar | `.pp3` profile | command line | code | — | code |
| Reads CR2, CR3, ARW, RW2, DNG | **yes** | yes (not iPhone ProRAW) | yes | yes (via LibRaw) | no (8.14) | yes | yes |
| Imports Lightroom, RawTherapee, Capture One, darktable presets | **all four** | darktable (+ Lightroom XMP in the GUI) | RawTherapee | — | — | — | — |
| Industry LUTs (.cube, .3dl, CLF, CDL, .spi3d, HaldCLUT) | **all** | .cube, .3dl, HaldCLUT | HaldCLUT | .cube, HaldCLUT | — | — | — |
| Install | **one static binary** | AppImage / packages | AppImage / packages | packages | packages | library + tools | Python + `pip` |
## Parallel by design
One photo is split across every core at every stage, and a batch keeps
several photos in flight. Recipes are deterministic, so a folder can also be
sharded across machines and give identical pixels.
<p align="center"><img src="docs/assets/architecture.svg" alt="Decode, develop, render and encode each split their work into tiles, planes or row bands across all cores; a batch scheduler keeps several images in flight" width="100%"></p>
<p align="center"><img src="docs/assets/scaling.svg" alt="One 24 MP raw: 5.2 s on one core, 1.05 s on eight (4.9×). A batch of 20 reaches 4.8 images per second" width="100%"></p>
## What it reads and writes
| | |
|---|---|
| **Camera raw** | Canon **CR2**, **CR3** (RAW and C-RAW), Sony **ARW** (uncompressed, compressed, lossless), Panasonic **RW2** (incl. recent bodies), **DNG** (Bayer and linear, lossless JPEG, Deflate, tiles; iPhone ProRAW). Decoded values are bit-exact with LibRaw 0.22.3 on all test samples. |
| **Images in** | JPEG (baseline, progressive; embedded ICC profiles such as Display P3 and Adobe RGB are honoured), PNG 8/16-bit, TIFF 8/16-bit (none, LZW, Deflate, PackBits; strips, tiles) |
| **Images out** | JPEG (parallel encoder, optimised Huffman tables, 4:4:4/4:2:2/4:2:0, sRGB ICC tagged, `--max-bytes`), PNG 8/16-bit, TIFF 8/16-bit |
| **LUTs** | `.cube` (Adobe / Resolve 1D+3D), HaldCLUT, `.3dl`, `.spi1d`/`.spi3d`, `.csp`, CLF (Academy Common LUT Format), ASC CDL (`.cc`/`.ccc`/`.cdl`), `.look`; export to `.cube` |
| **Presets** | Lightroom / Camera Raw `.xmp` and `.lrtemplate`, RawTherapee `.pp3`, Capture One `.costyle`, darktable `.dtstyle` (each maps the settings rawroom supports and reports the rest) |
`rawroom formats --json` prints the list for the build you have.
## How it works
* **Raw decoding** (`internal/raw`): one file per container, written from the
TIFF, DNG, ISOBMFF and T.81 specifications and public format notes, and
checked value by value against LibRaw. Tiles, slices, planes and blocks are
decoded in parallel.
* **Raw development** (`internal/develop`): black and white levels, white
balance (as shot, daylight, auto, kelvin plus tint), highlight
reconstruction that keeps blown skies from going magenta, RCD demosaicing
(or half-size for previews), camera-to-sRGB colour from the file's DNG
matrices or a 793-camera table, gamut compression, and a neutral tone curve.
Details: [`internal/develop/README.md`](internal/develop/README.md).
* **Edit pipeline** (`internal/render`): about 60 Lightroom-style controls
(exposure, contrast, highlights, shadows, whites, blacks, temperature, tint,
vibrance, saturation, 8-band HSL, colour grading, curves, clarity, texture,
dehaze, noise reduction, sharpening, vignette, grain) and LUTs, in float32,
with halo-free regional tone mapping. Algorithms: [docs/pipeline.md](docs/pipeline.md).
* **Geometry** (`internal/geom`): crop, aspect presets, rotate, flip,
straighten, Lanczos-3 resize.
* **JPEG** (`internal/jpegx`): decoder and encoder written for throughput, with
parallel IDCT and colour conversion, parallel restart-interval encoding and
DCT-domain downscaling.
* **Colour standards**: LUT results match ImageMagick, ffmpeg and OpenColorIO
to within rounding. See [docs/standards.md](docs/standards.md).
## Benchmark
<p align="center"><img src="docs/assets/speedup-matrix.svg" alt="Speed-up of rawroom over each tool for 15 tasks; every cell is above 1×, from 1.1× (rawpy, CR3 preview) to 61× (RawTherapee preview)" width="92%"></p>
Measured with [`bench/run.sh`](bench/README.md) on an 8-core Intel Core Ultra 7
258V laptop (30 GB, Linux), idle, against **darktable 5.6.2, RawTherapee 5.13,
ImageMagick 7.1.2, libvips 8.14, LibRaw 0.22.3 and rawpy 0.28** (LibRaw for
Python). Each cell is the mean wall
time of the whole command (process start to file written), hyperfine with warm-up.
Full tables, peak memory, contact sheets and every command are in
[`bench/results/REPORT.md`](bench/results/REPORT.md).
| task | rawroom | rawpy³ | LibRaw¹ | libvips | ImageMagick | darktable | RawTherapee |
|---|---:|---:|---:|---:|---:|---:|---:|
| RAW → full-size JPEG, Sony ARW 24 MP | **1.06 s** | 1.41 s | 2.95 s | n/a | 4.61 s | 4.52 s | 8.84 s |
| RAW → full-size JPEG, Canon CR3 20 MP | **0.86 s** | 1.14 s | 2.59 s | n/a | 3.43 s | 3.75 s | 5.80 s |
| RAW → full-size JPEG, Canon CR2 30 MP | **1.51 s** | 2.57 s | 4.44 s | n/a | 6.38 s | 5.08 s | 13.39 s |
| RAW → full-size JPEG, DNG 24 MP | **1.29 s** | 1.91 s | 3.90 s | n/a | 4.75 s | 4.66 s | 10.55 s |
| RAW → full-size JPEG, Panasonic GX80 16 MP | **0.68 s** | 1.27 s | 2.25 s | n/a | 2.96 s | 3.51 s | 5.44 s |
| RAW → 1024 px preview, Sony ARW | **0.12 s** | 0.75 s | 0.57 s | n/a | 3.69 s | 2.32 s | 7.34 s |
| RAW → 1024 px preview, Canon CR3 | **0.50 s** | 0.55 s | 0.65 s | n/a | 3.09 s | 2.12 s | 4.78 s |
| 24 MP JPEG + 33³ `.cube` LUT | **1.23 s** | n/a | | n/a | 13.12 s | 3.98 s | 3.98 s² |
| 24 MP JPEG, edit + resize to 2048 px | **0.56 s** | n/a | | 0.94 s | 1.56 s | 3.38 s | 2.26 s |
| batch of 20 × 24 MP JPEGs, edit + resize | **4.27 s** | n/a | | 5.13 s | 9.79 s | 30.80 s | 31.63 s |
| batch of 20 × 24 MP JPEGs, edit at full size | **10.61 s** | n/a | | 18.85 s | 40.72 s | 43.88 s | 51.52 s |
¹ `dcraw_emu` (AHD demosaic, single-threaded) piped to vips for the JPEG
encode; preview with `-h` half-size decode. ² RawTherapee cannot read `.cube`,
so it uses the equivalent HaldCLUT. ³ A Python script
([`bench/lib/rawpy_dev.py`](bench/lib/rawpy_dev.py)): rawpy `postprocess`
(LibRaw defaults, camera white balance) and Pillow for the JPEG; preview with
half-size develop and a Lanczos resize. Its times include starting Python
(about 0.15 s). rawpy develops raw files only. The RAW rows of rawroom, rawpy and
LibRaw were measured together, the other rows two days earlier on the same
idle machine.
All 20 raw samples (5 formats, 15 bodies) open in rawroom, rawpy,
RawTherapee, ImageMagick and LibRaw; darktable fails on the iPhone ProRAW DNG.
What the table does not show, so you can judge it fairly:
* **Looks differ.** Each tool's default raw rendering is different (demosaic,
tone curve, colour), so T1 compares speed, not output. Compare the looks in
the contact sheets.
* **Memory.** rawroom trades memory for speed: about 0.5–0.8 GB for one 24 MP
raw or JPEG (rawpy uses about 0.34 GB for the same 24 MP raw), and up to 7.4 GB for the full-size 20-image batch (it keeps
several images in flight; libvips streams and stays under 100 MB per
process). Reducing the peak is the next performance task
(see [docs/performance.md](docs/performance.md)).
* **LUT output** differs from ImageMagick's by a mean of 2.1 to 3.2 levels
(0–255), close to darktable and RawTherapee (1.9 to 2.1). The LUT
arithmetic itself matches ImageMagick, ffmpeg and OpenColorIO to within
rounding ([docs/standards.md](docs/standards.md)); the remaining
difference comes from JPEG chroma upsampling and encoding.
<p align="center"><img src="docs/assets/bench-raw.svg" alt="RAW to full-size JPEG times per format and tool" width="100%"></p>
<p align="center"><img src="docs/assets/bench-preview.svg" alt="RAW to 1024 px preview times per format and tool" width="100%"></p>
<p align="center"><img src="docs/assets/bench-jpeg.svg" alt="JPEG LUT, edit and batch times per tool" width="100%"></p>
<p align="center"><img src="docs/assets/memory-vs-time.svg" alt="Time against peak memory for a 24 MP Sony ARW: rawroom 1.06 s and 650 MB; rawpy 1.41 s and 340 MB; LibRaw 2.95 s and 249 MB; ImageMagick 4.61 s and 675 MB; darktable 4.52 s and 1039 MB; RawTherapee 8.84 s and 1185 MB" width="80%"></p>
The charts are generated from the result files by `bench/viz/make.py`
(`bench/viz/measure.sh` records the scaling and agent-loop numbers).
The harness, the exact command for every tool and the fairness rules are in
[`bench/`](bench/README.md). Run it yourself with `bench/run.sh`.
## Documentation
* [AGENTS.md](AGENTS.md): manual for AI agents
* [llms.txt](llms.txt): documentation index for language models
* [docs/cli.md](docs/cli.md): every command and flag
* [docs/mcp.md](docs/mcp.md): MCP server and client configuration
* [docs/pipeline.md](docs/pipeline.md): edit parameters and algorithms
* [docs/standards.md](docs/standards.md): LUT and preset formats, accuracy studies
* [docs/performance.md](docs/performance.md): performance notes
* [docs/security.md](docs/security.md): threat model, limits, fuzzing
## Build and test
```sh
go build . # Go 1.27+, standard library only, no cgo
go test ./...
scripts/fetch-samples.sh # CC0 raw samples from raw.pixls.us (about 800 MB)
RAWROOM_SAMPLES=$PWD/samples go test ./internal/raw/ ./internal/develop/
```
Contributions are welcome. Please read [CONTRIBUTING.md](CONTRIBUTING.md)
first: the project is clean-room, and its licensing rules for raw decoders
are strict.
## Licence
MIT (see [LICENSE](LICENSE)). Three files are ported from LibRaw and stay
under LibRaw's CDDL-1.0 option, a file-level licence: the Canon CRX codec, the
Panasonic RawFormat 8 decoder and the camera colour-matrix table. Two JPEG
files are adapted from Go's BSD-licensed `image/jpeg`. All of them are listed
in [NOTICE](NOTICE). Test assets keep their own open licences (see
[`standards/README.md`](standards/README.md)).
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues