I reduced Sony raws by 50% (lossless)

octacat1 pts1 comments

CompressARW — lossless Sony ARW that pretends to be a JPEG

Skip to compressor

Loading codec…

compress-arw · wasm · 0.1.0

Lossless Sony ARW.<br>Pretends to be a JPEG.

Uncompressed 14-bit Sony raw is bulky because the sensor data sits in the file as<br>16-bit-aligned samples. CompressARW leaves the camera JPEG and EXIF at the front of<br>the file, then packs the Bayer strip with same-channel deltas, a byte shuffle, and<br>zstd. The result is a .ARWC.JPG. Finder, browsers, and<br>exiftool stop at JPEG EOI. Decode splices the original ARW back together<br>bit-for-bit.

macOS Apple Silicon · CLI<br>Windows x86_64 · ARWC.exe

~½<br>typical size of the original ARW

49%<br>smaller on 10 A7R III files (zstd 19)

817 → 414<br>MiB for that set · WASM level 9 is ~2 MiB larger per file

In this tab

The codec is the same Rust library compiled to WebAssembly. Nothing is uploaded.<br>Use uncompressed .ARW from a body such as the α7R III (not Sony’s<br>lossy “compressed RAW”). Default zstd level is 9, which the crate recommends for<br>WASM.

Drop .ARW or .ARWC.JPG

or click to choose · several files run one after another

zstd

Working…

Which cameras

The codec does not look at the model name. It accepts Sony ARW whose raw strip is<br>uncompressed 14-bit, 16-bit aligned, at EOF — the camera menu item<br>RAW File Type → Uncompressed . Sony’s lossy “Compressed RAW” and<br>lossless-compressed ARW 4.0 are refused.

Tested

Sony α7R III (ILCE-7RM3). The rates and fixtures on this page are from that<br>body: 8000×5320, ~82 MiB per file.

α7R III

MENU → Camera Settings 1 → RAW File Type → Uncompressed. Single-shot and<br>continuous stay 14-bit. BULB and Long Exposure NR drop to 12-bit and will be<br>refused.

Same format

α7R II–VI, α7 II / III / IV, α7C / C II / CR, α7S II / III, α9 / II / III,<br>α1 / II, α99 II, RX1R II / III, ILX-LR1 — when Uncompressed is selected and<br>the file stays 14-bit.

Will not encode

Original α7 / α7R / α7S and most APS-C (compressed RAW only). α6700<br>(lossless compressed, no uncompressed option). 12-bit files from BULB, Long<br>Exposure NR, or silent shooting on some older bodies.

Compression rates

Ten uncompressed Sony ILCE-7RM3 files, 8000×5320, 14-bit samples in 16-bit words<br>(~82 MiB each). Same Bayer-delta + byte-shuffle + zstd pipeline this codec uses.<br>Each file compressed on its own. Decode is bit-identical. Noisy or high-ISO frames<br>shrink less; other bodies will differ.

817 → 414 MiB<br>zstd 19 · 49% smaller · ~51% of original

817 → 429 MiB<br>zstd 9 (WASM default) · ~2 MiB extra per file

File<br>Original<br>zstd 19<br>zstd 9<br>Saved at 19

OCT00527.ARW<br>81.9 MiB<br>46.0 MiB<br>47.6 MiB<br>43.9%

OCT01253.ARW<br>81.5 MiB<br>41.0 MiB<br>42.4 MiB<br>49.8%

OCT01840.ARW<br>81.6 MiB<br>39.2 MiB<br>40.8 MiB<br>52.0%

OCT02829.ARW<br>81.7 MiB<br>42.3 MiB<br>43.9 MiB<br>48.2%

OCT05023.ARW<br>81.7 MiB<br>38.9 MiB<br>40.6 MiB<br>52.3%

OCT05647.ARW<br>81.8 MiB<br>39.1 MiB<br>40.7 MiB<br>52.2%

OCT06077.ARW<br>81.9 MiB<br>40.6 MiB<br>42.2 MiB<br>50.4%

OCT08003.ARW<br>81.7 MiB<br>40.0 MiB<br>41.1 MiB<br>51.0%

OCT08389.ARW<br>81.8 MiB<br>43.9 MiB<br>45.4 MiB<br>46.4%

OCT08594.ARW<br>81.7 MiB<br>43.0 MiB<br>44.6 MiB<br>47.4%

Ten files<br>817 MiB<br>414 MiB<br>429 MiB<br>49%

Range on this set: 43.9%–52.3% smaller at level 19. Drop a file above to measure yours.

Compared with other lossless options

Same file: OCT00527.ARW, 81.90 MiB, uncompressed ILCE-7RM3.<br>Generic tools were given the whole ARW. CompressARW first does a Bayer same-channel<br>delta and a byte-shuffle of the 14-bit strip, then zstd — and still leaves a JPEG<br>that Finder and exiftool can read. JPEG XL here is the mosaic strip<br>only; the TIFF header would still need storing.

CompressARW · zstd 19

46.0 MiB

Shuffle + zstd 19

47.1 MiB

xz -9e on the ARW

50.9 MiB

JPEG XL lossless e7

51.2 MiB

xz -6 on the ARW

51.3 MiB

bzip2 -9

58.3 MiB

zstd -19 on the ARW

64.8 MiB

brotli -9

66.2 MiB

gzip -6

67.3 MiB

lz4 -9

80.6 MiB

Original ARW

81.9 MiB

Method<br>Size<br>Saved<br>Native decode<br>Notes

CompressARW, zstd 19<br>46.0 MiB<br>43.9%<br>~160 ms<br>JPEG + EXIF in front; bit-identical ARW

Shuffle + zstd 19, no predictor<br>47.1 MiB<br>42.5%<br>76 ms<br>Almost as small, slightly simpler

Same transform + xz -6<br>45.8 MiB<br>44.1%<br>990 ms<br>0.2 MiB smaller, ~10× slower

xz -6 on the raw ARW<br>51.3 MiB<br>37.4%<br>990 ms<br>Best generic compressor; no JPEG face

xz -9e on the raw ARW<br>50.9 MiB<br>37.9%<br>3.0 s<br>Too slow for WASM

JPEG XL lossless e7<br>51.2 MiB<br>37.5%<br>slow<br>Strip only; multi-MB decoder

zstd -19 on the raw ARW<br>64.8 MiB<br>20.8%<br>312 ms<br>Leaves ~19 MiB on the table

brotli -9<br>66.2 MiB<br>19.2%<br>610 ms<br>Browser-native, weak on this data

gzip -6 / zip<br>67.3 MiB<br>17.8%<br>267 ms<br>Same class as a zip of the ARW

lz4 -9<br>80.6 MiB<br>1.6%<br>57 ms<br>Fast, barely compresses

Not the same job

Option<br>Original ARW bytes<br>Opens as JPEG<br>EXIF without unpacking

CompressARW .ARWC.JPG<br>Yes, bit-identical<br>Yes<br>Yes

zip / gzip / xz / 7z of the ARW<br>Yes<br>No<br>No

Sony “compressed RAW” (lossy)<br>No<br>No — still an ARW<br>Yes

Sony lossless compressed (ARW 4.0)<br>Yes, Sony’s codec<br>No — still an ARW<br>Yes

Lossless DNG of the file<br>No — converted container<br>No<br>Usually

This tool only accepts uncompressed 14-bit ARW. Sony’s in-camera...

zstd sony file jpeg lossless uncompressed

Related Articles