Here's a more detailed description of matching the curve / baseline exposure. It's from a tutorial I'm working on but haven't published yet:
Choose a tone curve and exposure offsetsWhen we reproduce a scene on screen or on paper the luminance is typically lower which leads to that the eye experience the image as lower contrast, a bit dull even, this even if the (mid-tone) contrast is 100% accurate. This is a normal perceptual phenomenon and the solution is as old as photography: we apply an S-shaped contrast
curve. In digital photography there's more compression of highlights than shadows as that suits the linear sensor behavior better, but the principle is the same. By compressing highlights and shadows we get increased midtone contrast so the whole image seems to have higher contrast, and we can get a better perceptual match with the original scene.
A less known side effect of applying contrast is that the appearance of colors change. In human vision contrast and color appearance is tightly connected which means that if we want to retain the original color appearance when changing global contrast we must make some adjustments to the colors. Broadly speaking higher contrast requires higher saturation, and increased saturation is a natural side-effect of a basic RGB curve which is what's been traditionally used in digital photography. However an RGB curve will overdo saturation and it will also distort color so it's far from perfect, in fact there is still today no broadly used standard curve that is reasonably
perceptually accurate. (It's actually not possible to make it 100% accurate, as that would require image-dependent local adjustments which a camera profile can't do.)
DCamProf provides its own custom curve, a "neutral tone reproduction operator" to make it possible to embed a curve without distorting color appearance, and I think this is one of the more important features. Without that it doesn't matter how accurate we make our profile, as soon as we apply a curve in the raw converter the perceptual accuracy goes down the drain. And no, applying contrast in the Lab lightness channel or HSV value channel will not cut it (although it may work well for smaller adjustments or for creative effect). As I also contribute to the RawTherapee project, there's now actually a "perceptual" curve there which is based on DCamProf's
neutral tone reproduction operator, so for RawTherapee you can provide a profile without a curve and instead apply it using the builtin curve adjustment, but as far as I know RawTherapee is unique in this aspect. For convenience you may still want to embed it in the profile though.
For a longer more detailed discussion on how tone curves affect color, see
http://www.ludd.ltu.se/~torger/dcamprof.html#tone_curves tone curve section in DCamProf's reference manual.
Anyway, in order to make our profile fit for all-around photography we need to have an S-shaped tone curve to apply some contrast. So which shape to choose? With Adobe Camera Raw and the DNG reference code comes a standard curve which is used in many of Adobe's own profiles and it's also available as a built-in choice in DCamProf. It will provide a good result and if you don't have some special need I suggest using that (<tt>-t acr</tt> provided to make-dcp).
The typical reason to want some other curve is to better match the look of in-camera JPEGs. This can indeed be important. With Adobe's curve the look may become significantly brighter or darker than the in-camera JPEG, and while it's okay if you will "expose to the right" (ETTR) manually anyway (common for planned photography shot from a tripod), the camera's auto exposure is of course tuned for the in-camera JPEG curve. That is to get good results without adjustments you need the curve to match what the camera expects.
For DNG profiles there are actually three parameters for this, the curve itself, a baseline exposure offset and a black render tag. The DNG file itself can also contain a fixed baseline exposure which is added to the offset in the profile, at least if you're using Adobe's products. The exposure offsets and black render tag may or may not be
supported by your favorite raw converter, so they may not be usable. The curve is generally supported though if the converter has a decent DNG profile support.
The baseline exposure offset is sort of redundant as a curve can also include an exposure offset (it's just the average slope of it), but if the offset is large the curve gets an extreme shape which is hard to design so in that case it can be easier to separate them. The same can be said about the black render tag. That tag does not quantify an offset, it just tells the raw converter if it should make an automatic black subtraction (that is clip away darkest shadows if there is no detail there) or leave as is.
Matching the curve used by the cameraHow to get the curve from your camera? Obviously we could shoot a backlit step wedge and make a precise measurement-based match that way, but there's no real need to make an exact match, we won't have the exact camera appearance anyway concerning color. We just need to make a curve that has about the same brightness and contrast as the camera so when we use the camera's auto exposure we get a good result.
To do this I think visual matching works well, and you can use RawTherapee for that.
* If possible set the camera to write JPEGs together with the raw.
* If possible set color space to sRGB, unless you know what
you're doing and can display the JPEG properly with AdobeRGB (or
whatever the other color space is).
* Shoot basic sunny outdoor scenes with both highlights and shadows.
* It should be contrasty, but avoid back light.
* Avoid extremely saurated colors as they will exaggerate
differences between profiles and make it harder to match
curves.
* Preferably shoot more than one so you have a few to test.
* If you're using a DNG workflow, convert the raw to DNG using
your chosen DNG converter (it may add an baseline exposure offset
tag).
* If you use DNG files with non-zero baseline exposure and you
intend to honor that (as Adobe Camera Raw does), make sure
you apply corresponding exposure in RawTherapee (at the time
of writing RawTherapee ignores any baseline exposure in the
DNG file).
* If you couldn't get JPEGs directly, use for example exiftool to
extract the embedded preview image from the raw. If the color space
is not sRGB you may need to attach a profile to it (usually AdobeRGB)
which can also be done with exiftool.
* Make sure you get the camera's preview, not a re-rendered
preview made by your DNG converter if you're using that.
* exiftool -b -PreviewImage -w _preview.jpg _MG_0715.CR2
* exiftool "-icc_profile<=AdobeRGB.icc" _MG_0715_preview.jpg
* Open the raw file in RawTherapee and bring up the JPEG side by
side on screen, either by launching another RawTherapee instance and
open the JPEG there or bring it up in an image viewer.
* Apply (Neutral) processing profile so you get a clean start.
* Fold out "Tone curve 1" by choosing "Custom" (which is a spline curve).
* Curve type can be any, some are more saturated than others,
try one that matches the look of the camera JPEG the best (makes
it easier to match curve, optionally use the saturation slider
to make a better match.
* You can make the panel wider to make the curve larger and
easier to fine-tune.
* Add three control points to the curve, and make an S-shape
similar to the one shown in the screen shot, it's a good starting
point.
* Look at the darkest shadows in the JPEG and see if it's likely
some black subtraction has been made. If so match as well as
you can with the "Black" slider.
* Is the image considerably darker? Adjust "Exposure compensation"
to make a better match.
* Small offsets like 0.1-0.2 stops can typcially be solved by
brightening using the curve, while above that then it's better
to have an exposure compensation.
* Fine-tune the curve to match by moving and adding handles. Try
to keep down the number of handles, the more you have the harder it
becomes to make it smooth.
* Save the curve to an .rtc file.
* The .rtc file can be used directly by DCamProf.
* Write down if you had to adjust the black slider and how much
exposure adjustment you needed if any.
It is indeed hard to make an exact match, but it's not important. This is just about getting predictable results from the camera's auto exposure. It's more important that you like the shape of the curve, that it has suitable contrast and shadow compression. I often find it desirable to keep a little more shadow detail than camera JPEGs do for example.
If you had to adjust black subtraction and/or exposure you have some choices to make. Either you make a processing profile for your favorite raw converter that contains these presets, or you include the settings in your DNG profile. What is best depends on the feature set of the raw converter (if it supports the offset DNG profile tags or
not, and how presets are managed) and what you prefer.
You can also try to reshape the curve to compensate for any black subtraction and exposure offset.
If we start with black subtraction this can be 100% mirrored with a curve, but it will then unrecoverably cut shadows. It's better to just add an extra handle for the darkest shadows and compress a bit more there. Your will undoubltly get a less contrasty look in the shadow range this way, but also more shadow detail which you may
prefer anyway.
The exposure offset can also be mirrored with the curve but again not without unrecoverable clipping, so you could instead just increase highlight compression to increase brightness overall to match.
In general I think embedding an exposure offset in the profile makes more sense than black subtraction, especially since black subtraction cannot be set as a specific number but the result will instead vary between raw converters. My recommendation is thus combine the curve with an exposure offset if it makes sense, but try to avoid black subtraction.
The total baseline exposure should rather not be negative. That is the file's baseline exposure plus the profile's baseline exposure offset should be zero or positive. If you make it negative you will force the raw converter into showing potentially clipped highlights which is not a good default.
Notes on baseline exposureThe DNG specification has two baseline exposures, one that is stored in the DNG file itself, "baseline exposure", and one in the profile "baseline exposure offset". The latter was introduced in version 1.4 of the standard, prior to that baseline exposure could only be embedded in the DNG.
This is an unfortunate situation, if you ask me it's a poor design choice made by Adobe. The baseline exposure is 100% related to the profile, as it will depend on the curve shape which number you want. Naturally Adobe's DNG converter will embed a baseline exposure tag with its DNG files that is adapted to work with Abobe's proprietary profiles, and it may not really suit your profile.
It would be much better if the DNG profile itself specified all the baseline exposure, which it can with the new baseline exposure offset tag which is stored in the profile. Unfortunately the specification says that it shouldn't override the DNG file tag, but just adds an offset to it and that is what happens in Adobe's products. This means that you still need to know what value your DNG converter will put there, and if your raw converter cares about the value. Many raw converters can do both DNG and native raw. The native raw file has no baseline exposure offset, meaning that a DNG profile may need a different baseline exposure offset when used with native raws than when used with Adobe's DNGs.
I recommend to test your favorite raw converter to see how it reacts to baseline exposure, it's not certain that it will care about the value in the DNG file. It's not unlikely that you may need one offset for Adobe's products and a different offset for others.