Ad
Ad
Ad
Pages: [1]   Bottom of Page
Print
Author Topic: Looking inside DNG Camera Profiles  (Read 7925 times)
sandymc
Full Member
***
Offline Offline

Posts: 248


« on: February 09, 2009, 08:05:04 AM »
ReplyReply

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: 785



WWW
« Reply #1 on: February 09, 2009, 08:35:41 AM »
ReplyReply

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

~ CB
JeffKohn
Sr. Member
****
Offline Offline

Posts: 1671



WWW
« Reply #2 on: February 09, 2009, 01:16:16 PM »
ReplyReply

Thanks. This sounds like it could be really useful, I'll check it out.
Logged

Peter_DL
Sr. Member
****
Offline Offline

Posts: 421


« Reply #3 on: February 17, 2009, 04:08:06 PM »
ReplyReply

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, 04:09:52 PM by DPL » Logged
sandymc
Full Member
***
Offline Offline

Posts: 248


« Reply #4 on: February 18, 2009, 12:33:29 AM »
ReplyReply

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: 421


« Reply #5 on: February 18, 2009, 03:09:06 PM »
ReplyReply

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: 556


WWW
« Reply #6 on: February 18, 2009, 03:11:09 PM »
ReplyReply

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.
Logged

sandymc
Full Member
***
Offline Offline

Posts: 248


« Reply #7 on: February 18, 2009, 11:37:08 PM »
ReplyReply

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: 421


« Reply #8 on: February 20, 2009, 03:45:36 PM »
ReplyReply

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, 03:50:19 PM by DPL » Logged
Pages: [1]   Top of Page
Print
Jump to:  

Ad
Ad
Ad