Pages: [1]   Go Down

Author Topic: Looking inside DNG Camera Profiles  (Read 14062 times)

sandymc

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 350
Looking inside DNG Camera Profiles
« on: February 09, 2009, 09:05:04 am »

For those interested in the deep technical end of image processing with Adobe products, in a fit of frustration with Adobe's DNG Profile Editor, I've written dcpTool.

dcpTool is a compiler/decompiler for DNG camera profiles (DCP files), as used by Photoshop, Camera Raw and Lightroom. dcpTool can decompile binary format DCP files into an XML format for editing, and then compile the XML format file (editable with a text editor) back into a binary DCP file, as well as extract embedded profiles from image files. It runs on Windows and OS X command lines.

The web site, which also has some background material on DNG Camera Profiles and an example of a "decompiled" one, is here: http://dcptool.sourceforge.net/

Health warning: dcpTool is a command line utility - if you're not comfortable with command line stuff, dcpTool probably won't be of any interest to you.

Sandy
Logged

Chris_Brown

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 975
  • Smile dammit!
    • Chris Brown Photography
Looking inside DNG Camera Profiles
« Reply #1 on: February 09, 2009, 09:35:41 am »

Yes, but does it have mirror lock-up?  
Logged
~ CB

JeffKohn

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1668
    • http://jeffk-photo.typepad.com
Looking inside DNG Camera Profiles
« Reply #2 on: February 09, 2009, 02:16:16 pm »

Thanks. This sounds like it could be really useful, I'll check it out.
Logged
Jeff Kohn
[url=http://ww

Peter_DL

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 544
Looking inside DNG Camera Profiles
« Reply #3 on: February 17, 2009, 05:08:06 pm »

Quote from: sandymc
For those interested in the deep technical end of image processing with Adobe products, ... dcpTool is a compiler/decompiler for DNG camera profiles (DCP files), ... The web site, which also has some background material on DNG Camera Profiles and an example of a "decompiled" one, is here: http://dcptool.sourceforge.net/

>>> snipped from the 'About DCP Files' page >>>

The processing pipe
So, this is how, in vastly simplified form, you process your raw data in context of a DNG Camera Profile, assuming the Forward and Reduction Matrixes are not present (see the specification for more detail):

1. Linearize, rescale, do black level compensation, clip, etc.
2. Derive interpolated ColorMatrix and HueSatDelta matrixes based on the color temperature.
3. Get to an XYZ (absolute color space) via the interpolated ColorMatrix.
4. Convert to HSV.
5. Apply the interpolated HueSatDelta mapping table to get new colors.
6. Convert back to XYZ.
7. Do your exposure compensation, fill light, etc in whatever color space you want
8. Convert to HSV, apply the LookTable and ToneCurve, convert back. Or, if I read the spec right, use the LookTable and the ToneCurve as the basis for your adjustment settings

<<< snipped <<<
Interesting.

So when we create a Custom profile via the Chart wizard of the DNG profile editor, does it mean that the HueSatDelta table is applied according point #5 before Exposure compensation with point #7 while the LookTable according point #8 stays empty ?

Many thanks for your comment.

Peter

--
« Last Edit: February 17, 2009, 05:09:52 pm by DPL »
Logged

sandymc

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 350
Looking inside DNG Camera Profiles
« Reply #4 on: February 18, 2009, 01:33:29 am »

Quote from: DPL
So when we create a Custom profile via the Chart wizard of the DNG profile editor, does it mean that the HueSatDelta table is applied according point #5 before Exposure compensation with point #7 while the LookTable according point #8 stays empty

Yes - in all cases that I've seen, the standard Adobe profiles contain a LookTable and often, but not always, a tone curve. If you create a profile, what you get is a profile with either one or two HueSatTables, and a tone curve, but no LookTable. That appears to be regardless of whether the base profile you had selected in Profile Editor contained a LookTable or not. If you manually change the created profile, both the HueSatDelat tables and the tone curve are changed.

BTW, I'll be posting some visualizations of the "hue twists", etc in my blog (http://chromasoft.blogspot.com/) over the next day or two.

Sandy
Logged

Peter_DL

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 544
Looking inside DNG Camera Profiles
« Reply #5 on: February 18, 2009, 04:09:06 pm »

Quote from: sandymc
Yes - in all cases that I've seen, the standard Adobe profiles contain a LookTable and often, but not always, a tone curve. If you create a profile, what you get is a profile with either one or two HueSatTables, and a tone curve, but no LookTable. That appears to be regardless of whether the base profile you had selected in Profile Editor contained a LookTable or not. If you manually change the created profile, both the HueSatDelat tables and the tone curve are changed.
Again referring again to above drafted processing pipe, I’m puzzling over the Exposure slider and when exactly it comes into play. My understanding was that Exposure is one of 9 degrees of freedom (beside CT, Tint and 3x2 primaries) with the 3x3 matrix for conversion from demosaiced Raw RGB i.e. Camera color space to absolute CIE XYZ.

That way, the Exposure slider would already be applied with point #3 which is before application of any HueSatDelta table or LookTable, whether given with the Adobe Standard profile or a manually created Custom profile e.g. via the Chart wizard. Could this be possible ?

Many thanks for your comment.

Peter

--
Logged

Hening Bettermann

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 945
    • landshape.net
Looking inside DNG Camera Profiles
« Reply #6 on: February 18, 2009, 04:11:09 pm »

Hi Sandy,

Thank you for your posts here and your blog. The visualization with the Apple tool makes this accessible also for a number dumbie like me. I'll try to check my home-made DNG profiles this way.

sandymc

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 350
Looking inside DNG Camera Profiles
« Reply #7 on: February 19, 2009, 12:37:08 am »

Quote from: DPL
Again referring again to above drafted processing pipe, I’m puzzling over the Exposure slider and when exactly it comes into play. My understanding was that Exposure is one of 9 degrees of freedom (beside CT, Tint and 3x2 primaries) with the 3x3 matrix for conversion from demosaiced Raw RGB i.e. Camera color space to absolute CIE XYZ.

That way, the Exposure slider would already be applied with point #3 which is before application of any HueSatDelta table or LookTable, whether given with the Adobe Standard profile or a manually created Custom profile e.g. via the Chart wizard. Could this be possible ?

Peter,

As I read the spec/the DNG SDK source code, the HueSatDelta table is intended as a form of camera calibration, although Adobe don't use that term to describe it. So the HueSatDelta table come into play prior to the exposure control. In one sense, you can view it as a fine adjustment to the matrix. In fact, in common with the matrix, it's actual two table, at different color temperatures that requires interpolation. The LookTable on the other hand appear to be designed to set the "look" of the conversion, and is a single table.

In practice, Eric Chan from the Camera Raw team has confirmed the location as before the exposure slider - see here: http://www.adobeforums.com/webx?14@@.3bc03c04.59b77b09/37

Sandy
Logged

Peter_DL

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 544
Looking inside DNG Camera Profiles
« Reply #8 on: February 20, 2009, 04:45:36 pm »

Quote from: sandymc
In practice, Eric Chan from the Camera Raw team has confirmed the location as before the exposure slider - see here: http://www.adobeforums.com/webx?14@@.3bc03c04.59b77b09/37

Sandy
Sandy,

After reading through this discussion, I can understand Eric’s comment about “intentional design”. Directly translated from my first language: “you have to die one death”. Not sure if this makes sense in English. Anyway, it’s clear (also from referenced post #38) that the 3D LookTable is applied after Exposure correction.

In the meantime, Eric was kind enough to confirm the basic sequence of A.) 2D HS table e.g. from the chart wizard, B.) Exposure correction and C.) 3D LookTable. At least, that’s my understanding thereof. Still, I’d change above drafted processing pipe and the order of steps a bit.

Peter

--
« Last Edit: February 20, 2009, 04:50:19 pm by DPL »
Logged
Pages: [1]   Go Up