Add Canon R5m2 Colorinfo

Started by piratenpanda, August 29, 2024, 06:57:36 AM

Previous topic - Next topic

piratenpanda

Regarding my findings here (https://discuss.pixls.us/t/how-to-add-camera-support-to-libraw-darktable/44774) the necessary information for exiftool should be:

    0x80000496 => 'R5 Mark II',

I don't know how the ColorData is versioned, so I left it at 11, could as well be 12.

        {   (int16u[4528]) - R5m2
            Condition => '$count == 4528',
            Name => 'ColorData11',
            SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorData11' },
        },

            PrintConv => {
            34 => '34 (R3)', #IB
            48 => '48 (R7, R10, R6 Mark II)', #IB
            64 => '64 (R5m2/R1)',
        },

I don't know if this is all, just wanted to get the discussion started. Samples, if needed, can be found here:
https://www.pandainthecloud.de/nextcloud/index.php/s/qeMyi2sefdiYfjf

Phil Harvey

Thanks.  I'll look into this when I get a chance.

You don't mention the R1, but you have ColorDataVersion 64 as "R5m2/R1", so this also applies to the EOS R1?

- 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 ($).

piratenpanda

Quote from: Phil Harvey on August 29, 2024, 07:32:03 AMThanks.  I'll look into this when I get a chance.

You don't mention the R1, but you have ColorDataVersion 64 as "R5m2/R1", so this also applies to the EOS R1?

- Phil
According to the raw files from https://www.dpreview.com/sample-galleries/3304843825/canon-eos-r1-pre-production-sample-gallery/2560995570 it seems to be 64 there as well

Phil Harvey

Thanks!  I'll add the CanonModelID for the R1 as well.

- 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

I spent some time to look at this now.  There are changes since ColorData11, so this will be a new ColorData12 structure.  Here are the new offsets:

0x0000 Color Data Version              : 64 (R1, R5 Mark II)
0x0069 WB RGGB Levels As Shot          : 1956 1024 1024 1556
0x006d Color Temp As Shot              : 5411
0x006e WB RGGB Levels Daylight         : 1910 1024 1024 1591
0x0072 Color Temp Daylight             : 5200
0x0073 WB RGGB Levels Shade            : 2226 1024 1024 1336
0x0077 Color Temp Shade                : 7000
0x0078 WB RGGB Levels Cloudy           : 2068 1024 1024 1458
0x007c Color Temp Cloudy               : 6000
0x007d WB RGGB Levels Tungsten         : 1346 1024 1024 2416
0x0081 Color Temp Tungsten             : 3200
0x0082 WB RGGB Levels Fluorescent      : 1601 1024 1024 2367
0x0086 Color Temp Fluorescent          : 3576
0x0087 WB RGGB Levels Flash            : 2110 1024 1024 1446
0x008b Color Temp Flash                : 6149
0x008c WB RGGB Levels Unknown 2        : 1910 1024 1024 1591
0x0090 Color Temp Unknown 2            : 5200
0x0091 WB RGGB Levels Unknown 3        : 1910 1024 1024 1591
0x0095 Color Temp Unknown 3            : 5200
0x0096 WB RGGB Levels Unknown 4        : 1956 1024 1024 1556
0x009a Color Temp Unknown 4            : 5411
0x009b WB RGGB Levels Unknown 5        : 1956 1024 1024 1556
0x009f Color Temp Unknown 5            : 5411
0x00a0 WB RGGB Levels Unknown 6        : 1956 1024 1024 1556
0x00a4 Color Temp Unknown 6            : 5411
0x00a5 WB RGGB Levels Unknown 7        : 1956 1024 1024 1556
0x00a9 Color Temp Unknown 7            : 5411
0x00aa WB RGGB Levels Unknown 8        : 1956 1024 1024 1556
0x00ae Color Temp Unknown 8            : 5411
0x00af WB RGGB Levels Unknown 9        : 1956 1024 1024 1556
0x00b3 Color Temp Unknown 9            : 5411
0x00b4 WB RGGB Levels Unknown 10       : 1956 1024 1024 1556
0x00b8 Color Temp Unknown 10           : 5411
0x00b9 WB RGGB Levels Unknown 11       : 1956 1024 1024 1556
0x00bd Color Temp Unknown 11           : 5411
0x00be WB RGGB Levels Unknown 12       : 1956 1024 1024 1556
0x00c2 Color Temp Unknown 12           : 5411
0x00c3 WB RGGB Levels Unknown 13       : 1956 1024 1024 1556
0x00c7 Color Temp Unknown 13           : 5411
0x00c8 WB RGGB Levels Unknown 14       : 1956 1024 1024 1556
0x00cc Color Temp Unknown 14           : 5411
0x00cd WB RGGB Levels Unknown 15       : 1956 1024 1024 1556
0x00d1 Color Temp Unknown 15           : 5411
0x00d2 WB RGGB Levels Unknown 16       : 1956 1024 1024 1556
0x00d6 Color Temp Unknown 16           : 5411
0x00d7 WB RGGB Levels Unknown 17       : 1956 1024 1024 1556
0x00db Color Temp Unknown 17           : 5411
0x00dc WB RGGB Levels Unknown 18       : 1956 1024 1024 1556
0x00e0 Color Temp Unknown 18           : 5411
0x00e1 WB RGGB Levels Unknown 19       : 1956 1024 1024 1556
0x00e5 Color Temp Unknown 19           : 5411
0x00e6 WB RGGB Levels Unknown 20       : 1956 1024 1024 1556
0x00ea Color Temp Unknown 20           : 5411
0x00eb WB RGGB Levels Unknown 21       : 1956 1024 1024 1556
0x00ef Color Temp Unknown 21           : 5411
0x00f0 WB RGGB Levels Unknown 22       : 1956 1024 1024 1556
0x00f4 Color Temp Unknown 22           : 5411
0x00f5 WB RGGB Levels Unknown 23       : 1956 1024 1024 1556
0x00f9 Color Temp Unknown 23           : 5411
0x00fa WB RGGB Levels Unknown 24       : 1952 1008 1038 1553
0x00fe Color Temp Unknown 24           : 5188
0x00ff WB RGGB Levels Unknown 25       : 1952 1008 1038 1553
0x0103 Color Temp Unknown 25           : 5188
0x0104 WB RGGB Levels Unknown 26       : 1952 1008 1038 1553
0x0108 Color Temp Unknown 26           : 5188
0x0109 WB RGGB Levels Unknown 27       : 1947 1009 1038 1559
0x010d Color Temp Unknown 27           : 5166
0x010e WB RGGB Levels Unknown 28       : 2070 1023 1024 1494
0x0112 Color Temp Unknown 28           : 5845
0x0113 WB RGGB Levels Unknown 29       : 2087 1024 1023 1514
0x0117 Color Temp Unknown 29           : 5832
0x0118 WB RGGB Levels Unknown 30       : 2070 1023 1024 1494
0x011c Color Temp Unknown 30           : 5845
0x011d WB RGGB Levels Unknown 31       : 1958 1008 1039 1550
0x0121 Color Temp Unknown 31           : 5200
0x0122 WB RGGB Levels Unknown 32       : 1947 1009 1038 1559
0x0126 Color Temp Unknown 32           : 5166
0x0127 WB RGGB Levels Unknown 33       : 2125 1037 1010 1451
0x012b Color Temp Unknown 33           : 6449
0x0000 Camera Color Calibration 01     : -311  409  921 (10900K)
0x0004 Camera Color Calibration 02     : -294  417  898 (10000K)
0x0008 Camera Color Calibration 03     : -246  444  844 (8300K)
0x000c Camera Color Calibration 04     : -194  471  785 (7000K)
0x0010 Camera Color Calibration 05     : -134  507  719 (6000K)
0x0014 Camera Color Calibration 06     : -103  526  689 (5600K)
0x0018 Camera Color Calibration 07     :  -69  549  659 (5200K)
0x001c Camera Color Calibration 08     :  -24  579  618 (4700K)
0x0020 Camera Color Calibration 09     :   39  625  563 (4200K)
0x0024 Camera Color Calibration 10     :   96  672  520 (3800K)
0x0028 Camera Color Calibration 11     :  152  719  479 (3500K)
0x002c Camera Color Calibration 12     :  217  779  434 (3200K)
0x0030 Camera Color Calibration 13     :  263  828  406 (3000K)
0x0034 Camera Color Calibration 14     :  314  887  378 (2800K)
0x0038 Camera Color Calibration 15     :  431 1045  326 (2400K)
0x017f Per Channel Black Level         : 512 512 512 512
0x0294 Normal White Level              : 13535
0x0295 Specular White Level            : 14888
0x0296 Linearity Upper Margin          : 12735

(the ColorCalib structure is at offset 0x0140)

I'm sure this is not complete, so let me know if you discover the meanings of any unknown tags.

- 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 ($).

piratenpanda

Thanks, this helped a lot. As I'm a exiftool/fileformat noob mind guiding me to a place where I can read about how to identify those tags you identified? I mean the numbers are a small hint but when I extracted values some weeks ago using "-a -U -H -v4 -b" as mentioned on https://github.com/lclevy/canon_cr3 I can't think of a way to definitely say this is Daylight or this is asShot. So I must certainly lack some information next to experience.

Phil Harvey

AsShot was a guess based on the fact that it usually comes first.  To be sure about this you would have to change the camera white balance through a few settings and see how this changes.  The others I based on the ColorTemperature, which gives a good indication of which white balance setting it is for.

- 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 ($).