Z Cam zlog2 workflow

Hi folks,

This is a topic about the cameras from Z Cam not the DRT :slight_smile: .
@yooofi came to me with the question how he could manage some footage from a Z Cam camera shot in zlog2 for compositing properly. After some back and forth we came to the conclusion that their tools are a bit weird. I’m not an image engineer but I think there are at least some big question marks so hope any of you can help me get more clarity on this.

On their website they provide the following assets.

  1. ACES page with example script for Nuke, a DCTL and a zlog2 to linear .cube LUT + zlog2 color to AP0 and AP1 .spimtx files.
    image

  2. A LUT page with a zip download containing conversion LUTs and an OFX plugin.
    image

The interesting part is they seem to use a .cube file to convert zlog2 to linear within 0-1 float.
They then scale this up by multiplying but it’s inconsistent and vaguely commented.

DCTL:

DEFINE_LUT(Zlog2ToLinear, ./zlog2_to_linear_4096.cube)

__DEVICE__ float3 transform(int p_Width, int p_Height, int p_X, int p_Y, float p_R, float p_G, float p_B)
{
    float r = p_R;
    float g = p_G;
    float b = p_B;

// zlog2 to linear
    float3 res = APPLY_LUT(r, g, b, Zlog2ToLinear);

// gain factor for aces ap0, could adjust this factor according to the actual requirements
    r = res.x * 8.0f * 3.7f;
	g = res.y * 8.0f * 3.7f;
	b = res.z * 8.0f * 3.7f;

// zlog2 to acesap0
	res.x = 0.59268922f * r + 0.23980554f * g + 0.09364286f * b;
	res.y = 0.0078253f * r + 0.99994013f * g + (-0.07973914f) * b;
	res.z = 0.06103745f * r + (-0.24592234f) * g + 1.13939635f * b;
	
    return res;
}

So here they multiply by 8 and then again by 3.7 (why twice?).
However, in the Nuke example on the website it looks like a multiply of 7.416
The DCTL comment:

// gain factor for aces ap0, could adjust this factor according to the actual requirements

What is the idea behind this? Why change the exposure according to requirements? Shouldn’t this always be the same conversion no matter what you’ve shot?

I also found by eyeballing that a multiply of ~13.5 is pretty close to what you actually get if you use a .cube LUT to go to ACEScct instead, skipping the ‘hacky’ linear conversion LUT and use ACES Transform instead to convert to linear. Comparing that result with the same output transform yields the same result visually between the two. And whilst having tested on only 2 images the result made sense in terms of output exposure, even versus their own zlog2 to display conversion LUTs.
To double check my sanity I duplicated the DCTL file and changed the double mults to a single 13.5 value per channel and it matched my manual compensation.

Then there is their OFX plugin which works in Resolve but not in ReFusion or Fusion Studio is also quite the thing. If I insert it in a linear signal and set both input and output to zlog2 assuming a non-op, half of the image information on the bottom becomes clipped. I assume it’s using the same range limited cube LUTs. It has an option to output to AP0/linear. This is unusable because everything above 1.0 is unrecoverable. Yet the output option Rec709-lin does the same as that LUT zlog2_to_linear_4096.cube used in the DCTL requiring a gain boost after.

I wanted to share this information because I’m curious if any of it might make sense or that we are dealing with some issues we should see to be addressed if Z Cam is willing to look at it.

Has any of you ever had the need to work with Z Cam material? If so happy to hear your experience.
If you want to test yourself here is the clip I used which has some good brights on the first frame.
(Z011C0033_20201007061411_0001.MOV in the ProResHQ folder)

1 Like