Repository navigation
File Formats
21,049,052 bytes total, little-endian 16-bit samples:
-
54leading samples - skipped (header). -
2646rows x3976samples per row; only the first3968samples of each row are image data (the remaining 8 are discarded). - one trailing stride-row - ignored.
- values clamped to
16383(14-bit).
The decode yields the raw CFA mosaic - one 14-bit value per photosite, no
rendering applied. The RAW carries no EXIF; all metadata comes from the paired
.JPG.
Same filename stem as the .RAW. It is the sole metadata source: EXIF plus the
Leica MakerNote (copied verbatim into the DNG), which carries body serial, ISO,
exposure, focal length and the two light-meter readings used for aperture
recovery. See The Math.
Optional sidecar (same stem, .bia). The M8 writes it automatically on long
exposures (rarely on some dark frames), so treat it as optional and
non-deterministic. When present, it is subtracted from the CFA and BlackLevel is
forced to 0. See The Math.
| Quantity | Value |
|---|---|
| Full frame written (strip) | 3968 x 2646 |
Default DefaultCropOrigin
|
(2, 2) |
Default DefaultCropSize
|
3964 x 2642 |
--no-crop DefaultCropOrigin
|
(0, 0) |
--no-crop DefaultCropSize
|
3968 x 2646 |
| CFA pattern | RGGB (default; set with --cfa) |
The full 3968 x 2646 pixels are always written; --no-crop changes only the
DefaultCrop tags, never the pixel data (the two outputs differ by exactly 4
bytes). The default 2px border crop matches the original tool's output.
The original additionally reads a different geometry as a second input mode: a
genuine in-camera standard M8 DNG is 3920 x 2638, 8-bit - not the 3968 x 2646
RAW dump. Both width constants (3968 and 3920) live in the binary. m8raw2dng2
works only with the RAW+JPG format above; the standard-DNG path is the original's
alone (see The Original Tool).
That 2-px border is genuine sensor data, not black and not masked optical-black: the border pixels are ordinary photosites, continuous with the scene (on a lit frame the border reads close to the adjacent interior; on a dark frame it sits at the same pedestal as the interior). It is a thin demosaic-quality margin trimmed by DNG convention, and the original tool's DNG carries the identical crop tags - so both open the same way in ACR/Photoshop.
A hand-built little-endian TIFF (no library needed to write it), structured:
- IFD0 (47 tags)
- EXIF sub-IFD (21 tags)
- MakerNote (copied verbatim)
- Leica M8 colour matrices (Standard-A + D65 illuminants;
-cswapsColorMatrix1/2to the M9 "M8RAW" set and renames theModeltag to "M8RAW Digital Camera", leavingUniqueCameraModel, the illuminants andCameraCalibrationunchanged) - a single uncompressed strip of 16-bit linear CFA samples
Key tags: WhiteLevel 16383; CFA phase from --cfa; BlackLevel written only
with -b (tag only - see The Math); DefaultCrop as above. AsShotNeutral
is computed per shot from that frame's own data (not a fixed daylight value
stamped on every file), matching the original - so two frames can legitimately
carry different AsShotNeutral values. The Software tag carries the firmware
string read from the source JPG, and is omitted when the JPG has none;
UniqueCameraModel is M8 Digital Camera. Focal-plane resolution tags are fixed
M8 values.
- Default layout: the raw sits in IFD0, byte-identical to the original tool's own default output.
-
--legacy-preview: puts a sharp 3:2 JPEG preview in IFD0 and the raw CFA in a SubIFD - the standard in-camera M8 layout (the original's-pfollows the same two-IFD structure but embeds only a small 320 x 240 preview;--legacy-previewembeds a full-resolution JPEG). Fixes macOS Finder / QuickLook thumbnails and keeps files small. The preview is a baseline JPEG (YCbCr 4:2:0) written with the same tag set Adobe Camera Raw uses, so files land around 21 MB (just above the raw-strip floor) rather than the ~23 MB of a full uncompressed preview.--preview-sizesets the long edge (default 1024);--preview-uncompressedembeds RGB instead of JPEG (a fallback, not a quality switch - same pixels). The preview is auto-cleaned of hot-pixel and shadow chroma noise; the raw CFA is never touched.
Raw pixels are identical across all preview options.