ARRI and RED DRTs in OCIO

I have a setup in Nuke that creates a DRT in the style of ARRI ALF-2 and RED IPP2. This consists of
(1) a gamut conversion matrix (for example ACEScg to Arri AlexaWideGamut),
(2) a Nuke color space conversion linear to camera log (for example AlexaV3LogC),
(3) the camera LUT for Rec.709.

This works great in Nuke, and I am trying to get the same working in an OCIO config. The matrix (1) is easy, as is (3) the LUT. I’m however having a hard time with the colorspace part (2). In Nuke I have a Nuke colorspace node going from Linear to AlexaV3LogC

I would think this would be equivalent to an OCIOColorSpace with ACEScg to ARRI LogC (v3-EI800) AlexaWideGamut. But it clearly is not, and I cannot find any combination that works in OCIO. Can someone help me get unstuck here?

I think the issue may be that the OCIO built-in transform is going from ACES AP0 to LogC which does not make sense after the matrix from ACES into ArriWideGamut.

Both Nuke and ACES configs use a spi1d for log to lin. Can you not just take that file and write it in the config as file transform inverse direction?
Or are you looking for something built in for OCIOv2. Then I’m not sure how.

Yes this is for OCIOv2. I’m thinking this should be done with a LogCameraTransform but I’m unsure how exactly. A bit over my head.

As far as an OCIOv1 you are quite correct that I can grab the log2lin LUT from the nuke-default config and it works perfectly. Just trying to avoid using LUTs if possible.

Yea ARRI LogC v3 is not present in the latest ACES config yet. If you are building an ACES config just for testing/research you could snag the older description perhaps?

  - !<ColorSpace>
    name: Input - ARRI - LogC EI800 AWG
    family: Input/ARRI
    equalitygroup: ""
    bitdepth: 32f
    description: |
      Convert ARRI ALEXA LogC (EI800) ALEXA Wide Gamut to ACES2065-1
      
      ACEStransformID: urn:ampas:aces:transformId:v1.5:ACEScsc.Academy.LogC_EI800_AWG_to_ACES.a1.1.0
    isdata: false
    categories: [file-io]
    encoding: log
    allocation: uniform
    to_scene_reference: !<BuiltinTransform> {style: ARRI_ALEXA-LOGC-EI800-AWG_to_ACES2065-1}

That built-in transform still works if plugged in the release version. You’d just have to remove the matrix in your view transform as it’s included.
RWG/Log3G10 is already described with MatrixTransform + LogCameraTransform in that release config.

A bit of progress: got it working for RED. This does a lin to log for Log3G10:

        - !<LogCameraTransform> {base: 10.0, lin_side_offset: 2.55975327, lin_side_slope: 155.975327, log_side_offset: 0.0, log_side_slope: 0.224282, lin_side_break: -0.01, direction: forward}

Now I just need to figure out the same for ARRI LogCv3…

:exploding_head:
Brilliant, yes of course! Just tried that out and works perfectly!

1 Like

Hello Derek, very interested in using ARRI DRT with ACEScg, can you share your OCIO configuration?

There are 3 ARRI DRTs:
The classic K1S1
ALF-2
The new Reveal

I have the first two implemented in my OCIO config using an LMT made by @priikone. The advantage of doing it with an LMT is it does not require bypassing the aces output transform. If you are interested in that the config is here:

For the ARRI Reveal you’d still need to do it the way discussed in this thread. I can post my Nuke setup for that here. I’ll do that in a separate post.

1 Like

Here’s how I’m making the DRT. If I’m doing anything wrong here please do let me know!

To make the ARRI Reveal

  1. Convert the gamut from ACES to ARRI’s AWG4 using a matrix transform. In Nuke that would be AP1 to AWG4, in OCIO it would be AP0 to AWG4. I’m using this cool webpage from @Thomas_Mansencal to get the matrix. You can set it to give you a matrix for Nuke or for OCIO.

One thing I’m not so clear on is which CAT to use? Bradford? CAT02? :exploding_head: Assuming it’s CAT02 the matrix from AP0 to AWG4 would be:

<MatrixTransform> {matrix: [1.3317489220, -0.1910418312, -0.1407070910, 0.0000000000, -0.0010810260, 0.9928187215, 0.0082623045, 0.0000000000, 0.0006639882, 0.0007515137, 0.9985844981, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 1.0000000000]}
  1. Next you need to convert from the working color space into the color space of your LUT, so in Nuke from AP1 into LogC4 and in OCIO from AP0 to LogC4. The conversion for LogC4 is defined in the ACES Reference OCIO config as:
<LogCameraTransform> {log_side_slope: 0.0647954196341293, log_side_offset: -0.295908392682586, lin_side_slope: 2231.82630906769, lin_side_offset: 64, lin_side_break: -0.0180569961199113, direction: inverse}

  1. You get the LUT from the ARRI LUT Generator Webpage. Note that it says:

" Please note LUT Generator does NOT support ALEXA 35/LogC4!
You can download our current 3D LUT Package for LogC4 here
"

You would then add that LUT into your OCIO. For example:

<FileTransform> {src: "ARRI_LogC4-to-Gamma24_Rec709-D65_v1-33.cube", interpolation: linear}

So all together it would be:

  - !<ColorSpace>
    name: ARRI Reveal DRT
    family: Baked View Output
    isdata: false
    encoding: sdr-video
    from_reference: !<GroupTransform>
      children:
        - !<MatrixTransform> {matrix: [1.3317489220, -0.1910418312, -0.1407070910, 0.0000000000, -0.0010810260, 0.9928187215, 0.0082623045, 0.0000000000, 0.0006639882, 0.0007515137, 0.9985844981, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 1.0000000000]}
        - !<LogCameraTransform> {log_side_slope: 0.0647954196341293, log_side_offset: -0.295908392682586, lin_side_slope: 2231.82630906769, lin_side_offset: 64, lin_side_break: -0.0180569961199113, direction: inverse}
        - !<FileTransform> {src: "ARRI_LogC4-to-Gamma24_Rec709-D65_v1-33.cube", interpolation: linear}
        - !<RangeTransform> {min_in_value: 0., min_out_value: 0., max_in_value: 1., max_out_value: 1.}

The last line with the range transform is to clamp the output display values into a 0 to 1 range. Here’s the same in Nuke:

set cut_paste_input [stack 0]
version 14.0 v2
push $cut_paste_input
ColorMatrix {
 matrix {
     {0.9190871302 0.0251220731 0.0557907967}
     {0.0426505871 0.8542433209 0.1031060921}
     {-0.0054781525 0.00473652 1.000741632}
   }
 name ACEScg__to__ARRI_Wide_Gamut_4
 selected true
 xpos -291
 ypos 34
}
OCIOColorSpace {
 in_colorspace ACEScg
 out_colorspace "ARRI LogC4"
 name OCIOColorSpace3
 label "\[value in_colorspace]\n\[value out_colorspace]"
 selected true
 xpos -195
 ypos 61
}
OCIOFileTransform {
 file "/Users/Derek/ARRI_LogC4_v1_LUT_Package/LUTs/ARRI_LogC4-to-Gamma24_Rec709-D65_v1-33.cube"
 working_space ACEScg
 name OCIOFileTransform2
 selected true
 xpos -195
 ypos 131
}
1 Like
  - !<ColorSpace>
    name: Linear ARRI Wide Gamut 4
    aliases: [lin_arri_wide_gamut_4, lin_awg4]
    family: Input/ARRI
    equalitygroup: ""
    bitdepth: 32f
    description: |
      Convert Linear ARRI Wide Gamut 4 to ACES2065-1
      
      CLFtransformID: urn:aswf:ocio:transformId:1.0:ARRI:Input:Linear_ARRI_Wide_Gamut_4_to_ACES2065-1:1.0
    isdata: false
    categories: [file-io]
    encoding: scene-linear
    allocation: uniform
    to_scene_reference: !<GroupTransform>
      name: Linear ARRI Wide Gamut 4 to ACES2065-1
      children:
        - !<MatrixTransform> {matrix: [0.750957362824734, 0.144422786709757, 0.104619850465509, 0, 0.000821837079380207, 1.007397584885, -0.00821942196438358, 0, -0.000499952143533471, -0.000854177231436971, 1.00135412937497, 0, 0, 0, 0, 1]}

  - !<ColorSpace>
    name: ARRI LogC4
    aliases: [arri_logc4]
    family: Input/ARRI
    equalitygroup: ""
    bitdepth: 32f
    description: |
      Convert ARRI LogC4 to ACES2065-1
      
      CLFtransformID: urn:aswf:ocio:transformId:1.0:ARRI:Input:ARRI_LogC4_to_ACES2065-1:1.0
    isdata: false
    categories: [file-io]
    encoding: log
    allocation: uniform
    to_scene_reference: !<GroupTransform>
      name: ARRI LogC4 to ACES2065-1
      children:
        - !<LogCameraTransform> {log_side_slope: 0.0647954196341293, log_side_offset: -0.295908392682586, lin_side_slope: 2231.82630906769, lin_side_offset: 64, lin_side_break: -0.0180569961199113, direction: inverse}
        - !<MatrixTransform> {matrix: [0.750957362824734, 0.144422786709757, 0.104619850465509, 0, 0.000821837079380207, 1.007397584885, -0.00821942196438358, 0, -0.000499952143533471, -0.000854177231436971, 1.00135412937497, 0, 0, 0, 0, 1]}

I think the latest built-in studio config includes the LogC4 color space? Can they be used to reverse convert ACES2065-1 to LogC4?

and, is that mean u cannot use View and Looks to make ARRI Reveal work? so it cannot dirctly used in renderer’s renderview?

I did use the ARRI LogC4 from the Reverence config in my example above. I did not use the matrix because I believe it is going in the wrong direction since it is used for input rather than output, meaning it is AWG4 to AP0 rather than AP0 to AWG4.

1 Like

Not in Looks since these are combined with the ACES ODT. However you could use it in the Display. Take a look at my config at the “Non-Color Managed DPX Workflow” Display. You’d use the same workflow to get ARRI Reveal in the Display.

Is this because of RRT+ODT, can I understand that this cannot be bypassed? Isn’t it possible to customize a gamma2.2 transformation instead of using the built-in ODT?

Is it possible to define a display_colorspace that does nothing and then just apply logc4’s lut

Yes, that’s what my “Non-Color Managed DPX Workflow” does. On a LUT the RRT+ODT is combined. So you need to use it instead of the RRT+ODT.

image
I mean can we use that transform as OCIO Display?


I’m confused, you mentioned “wrong direction”, so is a transform like this actually wrong? Can’t OCIO automatically calculate the inverse transform?

Yes color spaces are invertible.
Yes you can create an OCIO Display.

In the OCIO config you need to define the Display and View, and point it to your color space.

displays:
  Camera DRT:
    - !<View> {name: "ARRI Reveal", colorspace: "ARRI Reveal - Rec709"}

These then need to be included in the active_display and active_views lists.

active_displays: ["Camera DRT"]
active_views: ["ARRI Reveal"]

doesn’t seem quite right,did i screw up something?

  - !<ColorSpace>
    name: ARRI Reveal DRT
    family: Baked View Output
    isdata: false
    encoding: sdr-video
    from_reference: !<GroupTransform>
      children:
        - !<MatrixTransform> {matrix: [1.3317489220, -0.1910418312, -0.1407070910, 0.0000000000, -0.0010810260, 0.9928187215, 0.0082623045, 0.0000000000, 0.0006639882, 0.0007515137, 0.9985844981, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000, 1.0000000000]}
        - !<LogCameraTransform> {log_side_slope: 0.0647954196341293, log_side_offset: -0.295908392682586, lin_side_slope: 2231.82630906769, lin_side_offset: 64, lin_side_break: -0.0180569961199113, direction: inverse}
        - !<FileTransform> {src: "ARRI_LogC4-to-Gamma24_Rec709-D65_v1-65.cube", interpolation: linear}
        - !<RangeTransform> {min_in_value: 0., min_out_value: 0., max_in_value: 1., max_out_value: 1.}
Camera DRT:
    - !<View> {name: "ARRI Reveal", colorspace: "ARRI Reveal DRT"}