Each image track of a CR3 file describes its picture in a CRAW sample
entry inside its stsd box (see boxes).
The layout below is from reverse engineering; Canon has published nothing. All numbers
are big-endian.
CRAW
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 4 | size | 0x3C for the JPEG track; 0xD4 or 0xE4 for raw tracks |
| 4 | 4 | type | CRAW |
| 8 | 6 | reserved | 0 |
| 14 | 2 | data reference index | 1 |
| 16 | 16 | reserved | 0 |
| 32 | 2 | width | Image width in pixels |
| 34 | 2 | height | Image height in pixels |
| 36 | 4 | horizontal resolution | 72.0 as 16.16 fixed point (00 48 00 00) |
| 40 | 4 | vertical resolution | 72.0 |
| 44 | 4 | – | 0 |
| 48 | 2 | frame count | 1 |
| 50 | 32 | compressor name | Unknown content |
| 82 | 2 | bit depth | 24 |
| 84 | 2 | – | −1 |
| 86 | 2 | flags | 3 for the JPEG track, 1 for raw and C-RAW |
| 88 | 2 | – | 0 for JPEG, 1 for raw and C-RAW |
| 90 | varies | child boxes | JPEG (12 bytes, a zero long) for the JPEG track; CMP1, CDI1 and free for raw tracks |
Up to offset 90 this is the standard visual sample entry of ISO base media, so the
field names at 14 to 84 follow that standard. The notes place the data reference index
at offset 12 in their table; the ISO layout puts it after the 6 reserved bytes, at 14.
The box sizes seen are 0x3C (JPEG), 0xD4 (small raw or C-RAW) and 0xE4 (full size); the
difference is the size of IAD1. The 12-byte JPEG child box is
its size, the type and a zero long.
CMP1: compression header
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 4 | size | 0x3C |
| 4 | 4 | type | CMP1 |
| 8 | 2 | – | Unknown (−1) |
| 10 | 2 | header size | Bytes that follow, 0x30 |
| 12 | 4 | version | 0x100 |
| 16 | 4 | image width | In pixels |
| 20 | 4 | image height | In pixels |
| 24 | 4 | tile width | Half the image width for large images, split into two slices |
| 28 | 4 | tile height | Tile height |
| 32 | 1 | bits per sample | Usually 14 |
| 33 | 4 bits | planes | 4: one per CFA colour |
| 33 | 4 bits | CFA layout | 0 RGGB, 1 GRBG, 2 GBRG, 3 BGGR |
| 34 | 4 bits | encoding type | 0 raw and C-RAW, 3 raw burst |
| 34 | 4 bits | wavelet levels | 0 for lossless raw, 3 for C-RAW |
| 35 | 1 bit | several tiles across | 1 when the image is split horizontally |
| 35 | 1 bit | several tiles down | Always 0 so far |
| 36 | 4 | track header size | Size of the tile, plane and subband headers at the start of the image in mdat |
| 40 | 1 bit | extended header | 1 when an extended header follows at 60 |
| 44 | 16 | – | 01 01 00 00 per plane, meaning unknown |
| 60 | 4 | extended header size | When the flag is set |
| 64 | 1 bit | median bit depth present | Second bit of the byte at 64 |
| 92 | 1 | median bit depth | Usually 14, when present |
| Offset | Field | Meaning |
|---|---|---|
| 36 (values) | track header size | Seen: 0x70 small raw, 0xD8 full size raw, 0x220 small C-RAW, 0x438 full size C-RAW |
| 33 (values) | CFA layout | The notes report 1 for the small image and 0 for the full size one |
| 34 (values) | encoding type | 3 is raw extracted from a roll (burst) file; with type 3, the median bit depth at 92 is used when combining intermediate buffers |
| 40 | extended header flag | The bit after it, and the 7 bits that follow, are zero; bytes 41 and 42 to 43 are zero |
| 64 | flags | First bit always 1, second bit is the median bit depth flag, six bits zero; bytes 65 to 67 zero |
| 68 | – | Six longs, meaning unknown |
Within each byte the first field named is in the high bits. The version is 0x100 for
every current file, and the notes do not separate the second codec version
(CanonCR3_002) in CMP1. The rest of bytes 40 to 43, the six
longs at 68 and most of the extended header are not understood.
CDI1 and IAD1: image areas
CDI1 is a full box (size, type, a version byte and 3 flag bytes) whose
only content is IAD1, so its size is the size of IAD1 plus
12. IAD1 holds shorts:
| Offset | Field | Meaning |
|---|---|---|
| 8, 10 | – | 0, 0 |
| 12 | width | Sensor width |
| 14 | height | Sensor height |
| 16 | – | 1 |
| 18 | slices | 0 for the small image, 2 for the full size image |
| 20, 22 | – | 1, 0 |
| 24–30 | crop | Full size image: left, top, right, bottom of the recommended crop. The small image has other values here (its width − 4, height − 1, width − 1, height − 1 on the EOS R), not fully understood. |
| 32–38 | left optical black | Left, top, right, bottom; full size image only |
| 40–46 | top optical black | Left, top, right, bottom; full size image only |
| 48–54 | active area | Left, top, right, bottom; full size image only |
IAD1 is 0x28 bytes (small) or 0x38 bytes (full size), so
CDI1 is 0x34 or 0x44; the notes' own table gives 0x3C, which does not fit
that rule. In the notes the values are numbered from the start of the box content: the
width is at 4 and 6, the slice flag at 10, the crop at 16 to 22, the left optical black
at 24 to 30, the top optical black at 32 to 38 and the active area at 40 to 46. The
values are offsets, so add 1 for a count. The table above adds the 8-byte box header.
Offsets here include the 8-byte box header. Coordinates are zero-based and inclusive. The active area is known to overrun the image by a few pixels on some cameras.
CTMD sample entry
| Offset | Size | Field |
|---|---|---|
| 0 | 4 | Size, 0x4C |
| 4 | 4 | CTMD |
| 8 | 4 | 0 |
| 12 | 4 | 1 |
| 16 | 4 | Number of record types, such as 7 (types 1, 3, 4, 5, 7, 8 and 9 in the sample) |
| 20 | 8 each | Per record type: a short (unknown), the type (short), and its size (long) |
The records themselves are in mdat; see
media data.
Sources
- Describing the Canon Raw v3 file format – Laurent Clévy, readme.md (revision of 16 September 2026): the CRAW, CMP1, CDI1, IAD1 and CTMD sections