View/Modify color matrix in DCP files

Hello, I often find that a lot of time in my raw editing is spent trying to tame wild wild out of gammut colors, and that a lot of the tools in Rawtherapee that can do so either have side effects or seem to occur after tone curves in the pipeline, even the gamma referred rgb mixer, which creates artifacts of various kinds, such as color inversions and flattened out or pre-clipped regions. Also sometimes the negative values created from out of gammut dark colors tend to create issues. What I would like to know how to do is find the numeric values in the color matrix inside a dcp file so I can left multiply it with a desaturating matrix, and use that new color matrix whilst still in linear color space for a better starting point, even if it means that the other tools inside the DCP aren’t applicable anymore, such as the LUT.

To enrich discussion, I also created this nightmare gamut scenerio of a play_raw. Deliberately difficult gamut colors in macro shot of hex nut

You can use DcamProf to read and write to dcp files; or you could convert the files to DNG and read those (they are just a TIFF, see the DNG Spec to index into the relevant tags). Though you have to know a bit about the make up of the profile not to get into trouble.

For instance Adobe in recent years has been using desaturated matrices to get into XYZ (with no negative terms in DNG converter and their own dcps) - then spreads things out again via the LUTs. DcamProf does something similar with default settings.

OK, now I have used your link to see what is inside dcp profiles, and have found four matrices, colormatrix1, colormatrix2, forwardmatrix1, and forwardmatrix2. I don’t know which does what, and what I’d want to perform the desaturation matrix multiplication operator to get my desired expanded gamut.

Update: So I’ve looked up the info in the DNG spec you linked, and it was clear that the colormatrix1 and colormatrix2 were just the different sides of the dual illuminant. The forward matrix part of the text was beyond my understanding, but I’ve read elsewhere that it seemed to not matter much, so safe to ignore?

Keep reading :slight_smile: Matrices (and related LUTs) are for the two spread-out illuminants indicated in the file, usually A and D65. They are interpolated based on the estimated correlated color temperature at the time of capture, in mired units.

If you are looking at an Adobe dcp, ColorMatrices are mainly used to determine CCT and take you from XYZ to ‘camera’ space as-is. ForwardMatrices are the ones you are interested in, take you from white balanced data to XYZD50 and are designed to potentially also work with LUTs, see the previous proviso. Good luck.

Jack

1 Like

Thanks kind sir. From your help, I have achieved success.

OMG that challenge pic with the pure blue lcd screen is so much easier to edit now with my desaturated color profile!

1 Like

Also of note is the companion dcamprof page, http://rawtherapee.com/mirror/dcamprof/camera-profiling.html. In the Appendix there’s a writeup on DCPs that describes the workflow they support.

Thanks for pointing this out! I’ve referred to the dcamprof documentation countless times but I never noticed the detailed description of the DCP pipeline!

1 Like

I hear you. I got so tired of trying to “recover” highlights and saturated color that I ended up making a custom DCP profile that transforms my camera’s native color into Arri’s Log-C Wide Gamut color space. Here’s an Arri Alexa still (from the web) to give you an idea what that looks like:

The nice thing about doing it this way is that Arri’s log tone curve and wide gamut color space are documented standards meaning that it’s simple to create or appropriate 3DLUT color transforms to shape the gamut and tones. The cool thing about doing this in the raw profile is that your exposure, white balance, etc, are all still happening in linear color, but the image is mapped to a film like log curve for editing giving much higher precision in the shadows for editing.

4 Likes

If you run windows or Mac you can use this free tool from Adobe to edit dcp files…you can use a raw file in dng format as a guide to your edits… https://digital-photography-school.com/adobes-dng-profile-editor-make-custom-camera-profiles/

You can also use any DNG file if you like the colors and use it as a DCP profile on your image…just load it instead of a dcp file…just as a quick way to see what it might possibly look like…

Great idea. Fitting dynamic range into range of image without tonal distortion side-effects was another issue I was having. Any links to tutorials? I got my cameras and I got a x-rite color checker passport.

Also, it would be great for better mixing Rawtherapee raw processed with Prores, as I can just use log profile conversions to get to ArriLog in Resolve.

Interesting… how did you define the tone curve for lumariver/dcamprof?

I downloaded the JPEG, it definitely re-energizes the S-curve. You got me thinking to do something similar with ACES2065-1, although that is still scene-referred…

how would you go about this on a given image?

Is this useful?? https://www.arri.com/en/learn-help/learn-help-camera-system/tools/lut-generator

Thought you might like this …good explanation of encoding https://nick-shaw.github.io/cinematiccolor/common-rgb-color-spaces.html

2 Likes

This looks really cool as well I may have to try to master this stuff

https://opencolorio.org/

Y’might take a look at PhotoFlow; @Carmelo_DrRaw recently incorporated OCIO…

I saw that …came across this as well…given your work with spectra might be of some use to you down the line…https://github.com/ampas/rawtoaces

rawtoaces is where I got my monochromator-measured D7000 SSF dataset. I’m exchanging emails with them about their licensing; if that works out I’ll add their cameras to https://github.com/butcherg/ssf-data