Canon RAW 2

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
(added extension)
(References)
(7 intermediate revisions by 4 users not shown)
Line 3: Line 3:
 
|subcat=Cameras and Digital Image Sensors
 
|subcat=Cameras and Digital Image Sensors
 
|extensions={{ext|cr2}}
 
|extensions={{ext|cr2}}
 +
|pronom={{PRONOM|fmt/592}}
 
}}
 
}}
 +
'''Canon RAW 2''' ('''CR2''') is a raw image format used by Canon cameras. It replaced [[Camera Image File Format|CRW]], starting with the 20D, 350D/Digital Rebel Xt and 1D. It was replaced by [[Canon RAW 3]].
  
Formats used by '''Canon''' cameras include:
+
== Organization ==
 
+
== CRW ==
+
 
+
CRW, aka [[Camera Image File Format]] is an attempt by Canon to standardise camera files.
+
 
+
== CR2 ==
+
 
+
Canon RAW 2 (CR2) came to replace CRW, starting the 20D, 350D/Digital Rebel Xt and 1D.
+
 
+
=== Organization ===
+
 
Canon CR2 files are TIFF files. All is organised in a TIFF / IFD file.
 
Canon CR2 files are TIFF files. All is organised in a TIFF / IFD file.
  
On of the differenciation with the CR2 files is that they have a header before the IFD0. This does not violate the TIFF spec.  
+
On of the differentiation with the CR2 files is that they have a header before the IFD0. This does not violate the TIFF spec.  
  
 
{|
 
{|
Line 25: Line 17:
 
| 0 || 8 || TIFF header
 
| 0 || 8 || TIFF header
 
|-
 
|-
| 8 || 2 || litteral 'CR'
+
| 8 || 2 || literal 'CR'
 
|-
 
|-
 
| 10 || 1 || major version (2)  
 
| 10 || 1 || major version (2)  
Line 36: Line 28:
 
Exif is attached to the ExifIFD of IFD0. The CFA data is in IFD3.
 
Exif is attached to the ExifIFD of IFD0. The CFA data is in IFD3.
  
=== Compression ===
+
== Compression ==
 
+
Canon CR2 files use the old original [[Lossless JPEG (original)|Lossless JPEG]] standard for the RAW data. The same used by [[DNG|Adobe DNG]].
Canon CR2 files use the old original [[Lossless JPEG]] standard for the RAW data. The same used by [[DNG|Adobe DNG]].
+
  
 
Source: http://www.adobeforums.com/cgi-bin/webx/.3bc36454/0 (link dead)
 
Source: http://www.adobeforums.com/cgi-bin/webx/.3bc36454/0 (link dead)
Line 48: Line 39:
 
The slicing means that the output scanlines have to be reorganised as they are shorter to have a top -> bottom then left -> right, a bit like columns of text. (TODO: do a nice diagram)
 
The slicing means that the output scanlines have to be reorganised as they are shorter to have a top -> bottom then left -> right, a bit like columns of text. (TODO: do a nice diagram)
  
=== Modified files ===
+
== Modified files ==
Apparently Canon's proprietary software modifies the RAW file. Other proprietary software seems to choke on said modified files (http://www.prophotohome.com/forum/raw-photo-processing-software-technique/62864-cr2-raws-converted-dpp-wont-open-aperture.html).
+
Apparently Canon's proprietary software modifies the RAW file. Other proprietary software seems to choke on said modified files (https://web.archive.org/web/20150512011452/http://www.prophotohome.com/forum/raw-photo-processing-software-technique/62864-cr2-raws-converted-dpp-won-t-open-aperture.html).
  
 
ExifTool has some info:
 
ExifTool has some info:
Line 55: Line 46:
 
* http://www.cpanforum.com/threads/5170
 
* http://www.cpanforum.com/threads/5170
  
=== References ===
+
== References ==
 
* http://lclevy.free.fr/cr2/
 
* http://lclevy.free.fr/cr2/
 
* http://web.archive.org/web/20061125031802/http://crousseau.free.fr/imgfmt_raw.htm (in French, by one of the developers of DxO) - Using the wayback machine !
 
* http://web.archive.org/web/20061125031802/http://crousseau.free.fr/imgfmt_raw.htm (in French, by one of the developers of DxO) - Using the wayback machine !
 +
* [https://github.com/lclevy/libcraw2/blob/master/docs/cr2_poster.pdf CR2 format documentation poster]
 +
* [https://twitter.com/lorenzo2472/status/536569538083844098/photo/1 Format poster image]
 +
* [http://web.archive.org/web/20140219063611/http://wildtramper.com/sw/cr2/cr2.html Canon's CR2 Raw File Format Specification]
 +
 +
[[Category:TIFF]]

Revision as of 19:34, 15 January 2020

File Format
Name Canon RAW 2
Ontology
Extension(s) .cr2
PRONOM fmt/592

Canon RAW 2 (CR2) is a raw image format used by Canon cameras. It replaced CRW, starting with the 20D, 350D/Digital Rebel Xt and 1D. It was replaced by Canon RAW 3.

Contents

Organization

Canon CR2 files are TIFF files. All is organised in a TIFF / IFD file.

On of the differentiation with the CR2 files is that they have a header before the IFD0. This does not violate the TIFF spec.

offset length description
0 8 TIFF header
8 2 literal 'CR'
10 1 major version (2)
11 1 minor version (0)
12 4 (long) for the offset of the IFD3 that contain the RAW data. (in the TIFF byte order)

Exif is attached to the ExifIFD of IFD0. The CFA data is in IFD3.

Compression

Canon CR2 files use the old original Lossless JPEG standard for the RAW data. The same used by Adobe DNG.

Source: http://www.adobeforums.com/cgi-bin/webx/.3bc36454/0 (link dead)

The width dimension specified in the JPEG stream is actually half the reality because it takes into account 2 channels per sample (the dimension of the CFA pattern).

350D, 5D and 30D files have a different layout. IFD3 (where the CFA is located) has the tag 0xc640 that contains 3 SHORT. 1, x, y. x is the number of column of the first "slice" of the image, y is for the second "slice". I don't know what the 1 mean.

The slicing means that the output scanlines have to be reorganised as they are shorter to have a top -> bottom then left -> right, a bit like columns of text. (TODO: do a nice diagram)

Modified files

Apparently Canon's proprietary software modifies the RAW file. Other proprietary software seems to choke on said modified files (https://web.archive.org/web/20150512011452/http://www.prophotohome.com/forum/raw-photo-processing-software-technique/62864-cr2-raws-converted-dpp-won-t-open-aperture.html).

ExifTool has some info:

References

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox