Create XYZ Matrix for Camera with Unknown Primaries

I have a new Action Camera which has an HDR mode.

The primaries and transfer function are unknown. I’m assuming a logarithm for the TF.

Is there any software that can take an image of an XRITE colorChecker taken under D65 lighting and calculate the RGB to CIE XYZ matrices?


Argyll scanin/colprof will also do the trick.

To use dcamprof, you’ll need Argyll scanin to make the .ti3 file from the ColorChecker image

Of note, to use dcamprof you’ll need to compile it from source. Argyll is available already-compiled.

Argyll tools will get you a matrix profile, and is probably the most expedient alternative. dcamprof will do that, and it also has a number of options to do other things like make a gamut compression LUT from that data.

Edit: Geesh, I’ve spent too much time with these tools… :grin:


@st599 Not sure if you run windows or mac or linux…two great GUI for argyll are RoughProfiler and CoCo They will let you run almost any version of a profile that Argyll can create…beats using command line and offers some help…


Many thanks all.

Had a quick play and it sort of works, but there’s a slight colour shift possibly due to the lighting that I images the test card under.

A similar (possibly related) question:

Let’s say I have a camera that has DNG+JPEG output support.

That camera has a JPEG mode that ALSO applies to video that has an unknown transfer function and unknown primaries.

I can use dcamprof to profile the DNG and create a DCP profile - but is there any tool that I can use to try and reverse engineer the primaries and transfer function of the JPEGs (which would also apply to video which cannot save raw/DNG data)

I suspect RT’s automatched tone curve would help with the transfer function reverse engineering - but is there any variation of AMTC that can use multiple images as a reference?

If you know the colorspace of the JPEG it’s trivial to convert it to XYZ, but from there, there isn’t a single path to a cogent camera primary set.

Off the top of my head, might consider stacking the multiple images first, then using the sum image as input to AMTC…

My issue is similar, there are a number of Action cameras and the like which have a wide colour gamut, high dynamic range mode and can capture JPEG or H.264. They use a proprietary transfer function and a primaries.

The Primaries don’t match any of the usual ones, 709, 2020, P3…

Once the primaries are known, I’m hoping to be able to write a nice tone mapper.

1 Like

I think dcam will let you get the transfer function from a tiff but I am not sure if that is a route…

Yup, and unlike many of the “proprietary but targeted towards professional use” colorspaces (Sony S-Gamut, etc) and transfer functions (Canon C-Log, Sony S-Log1/2/3, Panasonic V-Log, etc) which have their primaries and transfer functions documented somewhere, many of these lower end cameras have arbitrary transfer functions and primaries that aren’t documented.

For example, the only documentation on Yuneec’s “FLAT” profile mode is “Intended for color grading in postprocessing” - HOW? To properly color grade this, I need to know the transfer function, and I need to know the primaries. Neither of these are documented ANYWHERE. The saturation/contrast properties of the video when displayed with something that assumes it’s Rec709 hint strongly that it’s a wide gamut log-transfer system, but you can’t properly generate a LUT for such a thing unless you know the actual primaries of the gamut and the transfer function.

All of the documentation I see regarding tiff transfer functions is related to an assumption that the tiff was saved with appropriate transfer function tags.

In this case, we have a JPEG that, in my case, has (at most) a manufacturer specific tag that says it was saved with the “FLAT” profile - which is undocumented and unknown.

I wonder if you pull them in to DaVinci if you can get any info??

It might be a more challenging task but I suppose you could estimate the primaries and transfer functions in a trial and error sort of way.

What about Darktable chart. Create the lut and tone curve from the raw JPG pair. You could then apply that style to a haldclut PNG to make a lut as they do in raw therapies…might work??

Since it was co developed with Leica maybe try some Luts from Leica and see if you stumble on one that works??

You could try this approach with your JPG

Try to grab the color grade from it and make a lut