Directly editing DNG metadata and color matrices? - RAW Shooting and Processing - CHDK Forum supplierdeeply

Directly editing DNG metadata and color matrices?

  • 1 Replies
Directly editing DNG metadata and color matrices?
« on: 13 / November / 2008, 16:11:44 »
How do I directly change the color matrices and camera profile information for a DNG file?  (This may be useful for others who get better calibrations for their cameras)

I used DNG4PS-2 to convert a bunch of JPEG/RAW files from my Powershot A590-IS to DNG files.  Since there wasn't a color profile for the camera, I used the Powershot S5 IS profile as a rough, and ended up deleting the redundant CRW files.  Unfortunately,  that color calibration matrix is WAY off.  Now, I have a rough color calibration matrix that I can use for converting NEW RAW files.  I want to go back and overwrite the old color matrices with this one -- how can I?

If there isn't a program to do it, I'm familiar enough with binary and programming to write a one-shot for this.  But, I can't understand where and how the matrices are stored.  The DNG spec says the matrices are 3x3 arrays of type SRATIONAL (2 unsigned long ints describing a fraction in numberator-denominator order).  It also says the tag for the color matrix 1 has a tag code 50721.

I believe the tags are supposed to be datatype int32, but I can't find any instances.  I get numerous matching int16/uint16 hits, but they seem to be mostly random.  Could it be the lossless compression on the DNG files isn't just applied to the sensor matrix?

:EDIT: Found it!  Google "DngSetMatrix"
« Last Edit: 13 / November / 2008, 22:35:39 by acetone »


Offline vit40

  • ****
  • 276
Re: Directly editing DNG metadata and color matrices?
« Reply #1 on: 14 / November / 2008, 00:59:37 »
For last version, check here

A620 beta 1 profiles

I corrected a bug concerning DNGs with only one color matrix

You can also use general freeware exif editing tool - exiftool, that is way more powerfull (that one, of course, isn't written by me)


Related Topics