Introduction
CR2 is the raw photo format of Canon digital cameras from the mid 2000s until 2018, when Canon introduced CR3 with the EOS M50. A CR2 file holds the data read from the sensor, several previews and the camera’s settings, so the photo can be developed later with full control over white balance and exposure.
Canon has not published the format. Its layout is known from the work of independent developers, and every major raw converter reads it.
Structure
A CR2 file is built on TIFF. It starts with a little-endian TIFF header
(II, 42 and the offset of the first directory), and then, at byte 8, the
letters CR, the version 2.0 and the offset of the directory that holds the
raw data.
Four image file directories follow. The first holds a full size JPEG preview and points to the Exif and maker note data, the second a small thumbnail, the third an uncompressed reduced size RGB image, and the fourth the raw sensor data, compressed without loss using lossless JPEG and stored in vertical slices.
0TIFF headerII, 42, first IFD offset8 bytes8CR2 headerCR, version, raw IFD offset8 bytes…IFD 0 full size JPEG preview, Exif and maker notesvaries…IFD 1 thumbnailvaries…IFD 2 small uncompressed RGB imagevaries…IFD 3 raw sensor data, lossless JPEGvaries
The reference pages, based on public reverse engineering, cover the header and IFDs, the raw data and its slices, and the Canon maker note.
Not described
Canon has never published CR2. These pages follow libopenraw, dcraw and ExifTool; the parts below are not covered yet.
Known, not yet covered
- Reference: the entry-by-entry meaning of the Canon maker note sub-tables (CameraSettings, ShotInfo, FocalLength, AFInfo, CameraInfo, custom functions, processing and the others); ExifTool documents them, and the maker note page names the tags but not their entries. The ColorData tables are listed by index only, without their ColorCalib blocks or unnamed white balance sets.
- Reference: the per-camera sRAW and mRAW conversion coefficients, which open source decoders carry model by model (raw data).
- Viewer: none. The file opens as raw bytes only.
Unknown
- Reference: the contents of the Canon IFD tags
0xC5D8,0xC5D9,0xC5E0and0xC6DC, the values of0xC6C5, and how a reader detects which ColorData layout a file uses; none of the sources read here settles them. Laurent Clévy’s CR2 notes could not be reached for this check.
Links
Software
- Adobe Lightroom – Adobe’s photo library and raw developer (Windows, macOS, mobile)
- Adobe Photoshop – image editor that opens CR2 through its Camera Raw plug-in (Windows, macOS)
- Adobe DNG Converter – free tool that converts CR2 files to DNG (Windows, macOS)
- Capture One – raw photo editor for professional photographers (Windows, macOS)
- darktable – free raw photo developer (Windows, macOS, Linux)
- RawTherapee – free raw photo developer (Windows, macOS, Linux)
Developers
Reference
- Canon tags – ExifTool’s list of Canon maker note tags