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, Making a camera profile with DCamProf. 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ā€¦ How to Use Adobe's DNG Profile Editor to 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?? LUT Generator | Tools | Learn & Help

Thought you might like this ā€¦good explanation of encoding Common RGB Color Spaces

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ā€¦GitHub - ampas/rawtoaces: RAW to ACES Utility

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 GitHub - butcherg/ssf-data: Spectral sensitivity data for digital cameras