Using exiftool to import from Canon DPP to Lightroom

Started by Kier, November 06, 2017, 08:48:10 AM

Previous topic - Next topic

Kier

I have about a hundred thousand Canon 20D and 1D2N .CR2 images from the distant past that were processed using Canon DPP and have development recipes baked into the files.

I've been wanting to bring them all into Lightroom for some time, and then I had an idea, which seems to work.

(For each image...)

  • Extract the CanonVRD tags from the .CR2 using exiftool
  • Parse out the interesting bits - primarily this is just the exposure adjustment and the white balance
  • Write the values for those into a .XMP sidecar file next to the corresponding .CR2
  • Import the .CR2 into Lightroom, and the adjustments specified in the .XMP are automatically applied, in Lightroom's normal non-destructive fashion
I've got a test script with this working nicely, though it currently only applies the exposure adjustment, because I'm struggling to find a decent explanation of how to convert Canon's RGGB adjustment values into temperature and tint for use in the .XMP.

(example)
WB Adj RGGB Levels: 2582 1024 1024 1083

Can anyone offer any help with an algorithm?

Phil Harvey

It may be easier to use the Composite RedBalance/BlueBalance tags for this purpose.  These are derived from WB levels tags, and specify a multiplicative factor to be applied to the Red/Blue tones respectively.  I don't know what Lightroom uses for this.

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

Kier

Thanks for the reply Phil, but those values don't seem to change in response to custom white balance adjustments made in DPP

Kier

Just in case I wasn't clear initially, I need to take these RG(G)B values:

WB Adj RGGB Levels: 1672 1099 1099 2301

and convert them into color temperature (in Kelvin) and tint (which I believe is based on hue adjustments in HSV space) - in the XMP sidecar, they would look like this:

crs:Temperature="3300"
crs:Tint="0"

Phil Harvey

Oh, right.  You are using the WBAdjLevels, not WBLevels.  For RGGB levels the red/blue balance is R/G and B/G respectively, so for your example, this is 1672/1099 and 2301/1099.

But I don't know how to convert these to a color temperature/tint. 

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