TIFF Tag 0xC5E0 in Canon CR2 files

Started by edhannon, March 11, 2017, 10:28:54 AM

Previous topic - Next topic

edhannon

I believe I have discovered the meaning of tiff tag 0xC5E0 in Canon CR2 files.  I believe it is the CFA Pattern type. Where:

Type 1 is 0;1;1;2
Type 2 is 2;1;1;0
Type 3 is 1;2;0;1
Type 4 is 1;0;2;1

Most CR2 files have type 1 (e.g. 40D, 70D). Others have type 3 (e.g. 1D Mark IV, 60D).

I have been writing software to process RAW files and have found that some Canon files require CFA of 0;1;1;2 to process correctly while others need 1;2;0;1.
There is direct correlation from tag 0xC5E0 to CFA pattern needed.

I have tested this against all of the sample raw files I have (from Image Resource)

Phil Harvey

Hi Ed,

Great, thanks!  I'll add this as soon as I get a chance and post back here if I have any questions.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

OK,  I'm going to decode this as follows:

        1 => '0 1 1 2' => '[Red,Green][Green,Blue]',
        2 => '2 1 1 0' => '[Blue,Green][Green,Red]',
        3 => '1 2 0 1' => '[Green,Blue][Red,Green]',
        4 => '1 0 2 1' => '[Green,Red][Blue,Green]',

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).