camicc: converting Adobe's DCP profiles to ICC for darktable

And that is the key point: distribution. Private use of legally obtained files is allowed (and in any case hard to check/prevent). Same as with peer-to-peer: they don’t prosecute for the downloading, but for the uploading part of the process…

Using a tool to produce a work never makes that thing a derived work, as far as I know, except in the case where the tool embeds a part of itself in what was created–that’s why runtime libraries meant to be bundled into executables are licensed very permissively, separately from the rest of the compiler.

@dark_photon It’s good to scratch an itch, but you should know you can do this manually by using dcamprof to convert the DCP to a profile, then convert the profile to an ICC.

Is this tool outputting LUT or matrix ICCs? I think LUT input ICCs are unsuitable for scene-referred workflows since they don’t handle extreme colors (and are not well supported in darktable). I think the normal method is to use a matrix-style ICC as the input and do any additional correction in the color calibration module.

1 Like

But there is where layers get very nitty-gritty.

According to my understanding, an ICC is a matrix used in the process of calculating the colours from your image.

It is not the algorithm, no, it is input data.

So the resulting image is partially the result of multiplying the sensor data with the color profile. (I am know that I am over simplifying here).

So you can argue that it derived work.

It is not that I think that such an argument will hold in court, but I don’t want to bet on it…

That’s not even the point here. Here, the tool takes (possibly copyrighted) data, transforms it and writes output. That output might be a work derived from the input, but (the copyright status of) the tool is irrelevant in this case.

Exactly…

You’re right. Even knowing the correct answer wouldn’t be that useful, because copyright is interpreted differently everywhere.

Since we aren’t talking about publication in this example, first-sale doctrine would probably win over copyright. Meaning, if you lawfully own something, you can do whatever you want with it. I’m not a lawyer, though.

That’s another wrinkle: afaik, you don’t buy Adobe software, but a licence to use the sotfware, and such a license can come with restrictions on said use, restrictions to which you agreed in the contract…

But yeah, I misread, OP isn’t offering to distribute profiles, just the tools to generate them.

I tried dcamprof, but I could not get the expected results. The image was always super gray, and nothing like the expected thing. I read some old posts about using dcamprof, but still no success.
Then I ask AI to help use dcamprof, and it said that “dcamprof converts a DCP to ICC through its native profile format, which only has fields for the matrices — so the HueSatMap, LookTable, and tone curve that carry the entire “camera look” (contrast and saturation) are structurally dropped, leaving a flat, gray-ish colorimetric profile.” .
Also, dcamprof is 6 years without any updates, which made think I would be easier to just ask AI to make a similar too with this issue fixed. I went overboard and decided to automate the download, and extraction of the Adobe’s DCP, which is not convenient to do on Linux (install wine, etc).

As I said, I don’t know about this color science hacks, so I can say what the AI tells me: “LUT by necessity — the DCP’s look lives in 3D tables no matrix can express”.

I will investigate more if this is an issue.

2 Likes

I appreciate the discussion if I could get in trouble about this tool.

But besides the automated download of the Adobe DCPs, is my tool doing something fundamentally different than what Rawtherapee does when it interprets Adobe’s DCP (which the user manually downloaded)?

If not, then I will sleep fine knowing I am not doing something so different than some people already do with Rawtherapee (and Rawtherapee itself explains how to do it).

1 Like

For me, the quick test is editing a photo with very high dynamic range, such as a photo of a sunset, or anything with sunlight on light colored things, and dark color in shadows. In my tests with LUT input profiles from dcamprof, the highlights change color and lose all contrast. Other people on this forum have posted issues as well.

1 Like

The question is, then, whether the chosen form of output (an ICC profile) is the correct way to encapsulate the look. Could you please ask AI to help you produce two profiles separately, instead?

  1. A LUT-free profile that correctly encapsulates the colorimetry, but not the curves. This would be used during the “input color profile” step.
  2. A separate (abstract?) profile or maybe a LUT that encapsulates just the curves, i.e., the look, to be applied instead of the traditional tone mapper or, well, as a 3D LUT.

The difference is that, between these steps, other transformations can be inserted, and the majority of the workflow remains scene-referred.

So I already had an idea that this separation already exists in this project (to an certain degree) as there are two ICC produced for each DCP: one ICC without the tone curved, meant to be used with the tone mapper of choice (sigmoid, agx, etc); and another ICC with the tone curve that must have any tune mapping module disabled.

But here is what AI told me about your question:

Half of this already exists: each DCP converts to two profiles, and (colors only) is basically your step 1 — color tables only, no curve. You keep sigmoid/filmic and everything in between stays scene-referred. (camera look) is just both steps bundled. For step 2, sigmoid itself gets surprisingly close to the Adobe curve (contrast 1.95 / skew −0.225 lands within ~3 mean diff of Lightroom in my tests).
The catch is that step 1 can’t be LUT-free. The HueSatMap/LookTable are genuinely 3D — hue-dependent hue rotations and saturation boosts (up to ~1.7× on skin tones) — and a 3×3 matrix can’t express that. Matrix-only is exactly what dcamprof does, and that flatness is why I wrote this.
So the 3D table has to live somewhere, and darktable’s only other option is the lut 3d module — which also clips to [0,1], so the clamping @finestructure mentions would just move, not disappear. It also sits after the tone mapper by default, which is the wrong side: the DCP tables operate on scene-linear values, so applying them post-tone-mapping stops matching Adobe’s pipeline. Put it before the tone mapper and you’re back at the input-profile position anyway.
The highlight clamping is real (it’s in the README limitations), but it’s a limitation of every LUT container darktable can load, not of ICC specifically. The only truly unbounded way to apply a DCP is native support in the raw developer, like RawTherapee has. Short of that, (colors only) + a scene-referred tone mapper is as close to your proposal as darktable gets.

I want to be honest and say I don’t understand those terms like HueSatMap mean. I really need to study this stuff.

If the claims of this AI are correct, maybe the question is why not introduce the support of DCP files in darktable like Rawtherapee does?

And again, I don´t have enough understanding of this subject to say something more meaningful about the support DCP files in darktbale.

@hatsnp & @Pascal_Obry I am tagging you in this conversation, not directly to comment on the whole converting DCP profiles conversation, but more as ‘collective developers memory’. Is there are specific reasons to why darktable does not support DCP (as supposed to Rawtherapee) And is this something to considering crafting as a feature request?

2 Likes

I am not a darktable developer :smiley: Wrong ping?

Yes I mean @hannoschwalm, Sorry!

1 Like

There’s some info to get you started in the RawTherapee docs: Color Management - RawPedia

The dcamprof documentation may also be useful: DCamProf

And maybe less directly so, but still:

1 Like

+1 on the dcamprof documentation. This particular page is not obvious, and it has a great discussion on the Adobe workflow, including the role of the HueSatMap:

https://rawtherapee.com/mirror/dcamprof/camera-profiling.html#dng_profiles

1 Like

it’s simply no one implemented it :wink: and usually stuff isn’t implemented if no one sees a value in spending effort to implement it.

2 Likes

Their own Adobe profile editor is free to use…no idea if there is any stipulation…

Considering that the dual-illuminant feature of DCPs is really valuable, I’ve always thought that their absence is somehow related to darktable’s internal logic. If it isn’t, that’s good news. :smiley: