LUT for RRT+ODT for EXR in Premiere

I’d like to read EXR files in ACES AP0 color space into Premiere and view them through an Output- sRGB LUT. Making this more complicated, Premiere appears to apply a vanilla sRGB display transform to EXR files, meaning that the LUT would need to be the RRT without the ODT I believe.

At any rate I’m getting tied up like a pretzel and would appreciate some help untangling my brain! Does such a LUT exist already? If not how would one create this in either Resolve or Nuke?

As an update, I can get a good match in Premiere with a LUT applied to a DPX file in ACEScct. What I am unable to do is get a LUT to work with an EXR in AP0. Curious how others are handling this as I had understood that EXR AP0 was the ACES exchange format. Wondering if that workflow is perhaps not viable with Premiere…

Because an EXR will have data above 1.0, you would need a shaper to bring it into the 0-1 range (and change the gamma that Premiere will have applied to a more suitable log curve).

Last time I tested, Premiere supports only 1D or 3D LUTs, not 1D + 3D. So you need to do it with two separate LUTs. You could put one in the Input LUT slot and one in the Creative slot of a Lumetri effect.

It’s slightly complex, but should be possible. I’ve done similar things before.

Thanks for the tip Nick! Is it possible to write the 1D prelut in Nuke? I’m not having much luck. For a 1D+3D LUT I would do the following in Nuke:

CMS test pattern
generate LUT (.cube)

book-ending the inverse log and log around the grade. For a separate 1D shaper LUT I’m guessing I would do this:

CMS test pattern
Gamma 0.455
generate LUT (.cube)

This however clips and says in the file:

TITLE "Generated by Foundry::LUT"

With no mention of a 1D LUT. So I’m obviously not doing this right. Is there a write-up of making 1D shaper LUTs you could point me to perhaps?

I suspect that the main problem I’m bumping up against is the display 2.2 gamma that is being added on to the OpenEXR by Premiere. This is I think what is causing the clipping. I think in earlier versions it was possible to disable that “linear conversion,” but I cannot find the option in Premiere Pro 2020.

Do most people instead just use Apple Prores 4444 (in ACEScct) in Premiere? The EXR route with Premiere seems not quite ready for prime time.

If you have access to the BorisFX Sapphire suite, they have an OCIO plugin! That will make things a lot easier. Wish Adobe would just implement that but they’re too proud of their ancient management system that is totally locking out the user on most parts.

Otherwise the prores cct route seems a more efficient option it will read / playback a lot smoother too.

Thanks, that’s good to know about Sapphire and OCIO!

I don’t think Nuke’s LUT generator can do 1D LUTs. I personally use Colour Science for Python to build LUTs (1D and 3D). Here is an example of building 1D LUTs. Or you could use something like Lattice, which can create LUTs to go between specified colour spaces, and can also build a 3D LUT from a series of CTLs.

Here’s simple ACEScct ramp with a sampler that can export SPI 1D and Resolve 1D LUTs (see the Export tab in the Sampler).

ACEScct_ramp_1dlut.nk (84.0 KB)

@nick and @priikone thank you both for these resources!

Pekka I’m seeing that your Nuke script has the min/max values of 0 to 1.4679964 for the cct to lin LUT. The ACES 1.1 OCIO config ACEScct_to_linear.spi1d has -0.24913611 to 1.468. Should I be using those min/max values from the OCIO config instead?

If you want to cover more negative values. 0 in ACEScct is tiny bit negative already. I’d be interested to know how OCIO came up with that -0.24913611. Is that for a specific reason or just some arbitrary choice?

LOL, that’s my line!

1 Like

@priikone I’ve been experimenting with your Nuke 1D LUT script, and I wanted to say it’s really wonderful, thanks so much for sharing it!

Did you get it to work already in Premiere? If so would you mind sharing your setup? :slight_smile:
I tried to get it to work throug OCIO but it seems Nuke’s sRGBf only supports up to 5 float so the lightsaber isn’t accurate in this example. (the way I wrote it is probably also incorrect but it works i guess)

I don’t have access to Nuke commercial so couldn’t have a look at the 1D Lut script.

I also tried an exposure effect in AE with gamma set to 0.4545 which works minus the toe, but it seems that there is absolutely no similar built-in effect in Premiere to achieve this.

@Shebbe Sorry no, I have not gotten it to work. I believe that this may be a dead-end as it looks like Premiere is first applying the display gamma to the EXR and then applying the LUT. I have not had any luck reversing that. As you said, the whole thing is black boxed.

I’m thinking that OCIO is likely the best method for EXR in Premiere as you suggested. I have not had a chance to try that out though.

Regarding your test, I’m wondering if perhaps the light sabers render is not the best image to use as it was made with the intention of a stress test for the limits of ACES 1 gamut.

@Shebbe P.S. The light saber EXR is in AP0 so it should be
in: ACES-2065-1 out: Output - sRGB.
The reference to “sRGB primaries” refers to the colors @ChrisBrejon used for the render.

Ah, you are totally right. The lights in the scene are AP1 and the file AP0. Misread the filename.
I know the scene is meant to stress test that’s why I wanted to test it for easier verification if I could get the same results.

Inside AE comparing with difference (against the perserveRGB reference) you can clearly see that the lights aren’t the same, but even after boosting exposure this difference stays locally to the light’s cores. The overall scene is quite spot on.

Here’s the scene inside Premiere:

And here an example with IPP2:

This is the code I used and you need to go from lin-srgb to this.
There’s probably a more logical way to write this so you can go from this to lin-srgb instead but I’m not that smart :slight_smile: . If anyone can please show me.

  - !<ColorSpace>
    name: Utility - sRGBf
    family: Utility
    equalitygroup: sRGBf
    bitdepth: 32f
    description: |
    isdata: false
    allocation: uniform
    allocationvars: [-0.125, 4.875]
    from_reference: !<GroupTransform>
        - !<MatrixTransform> {matrix: [0.952552, 0, 9.36786e-05, 0, 0.343966, 0.728166, -0.0721325, 0, 0, 0, 1.00883, 0, 0, 0, 0, 1]}
        - !<MatrixTransform> {matrix: [3.2096, -1.55743, -0.495805, 0, -0.970989, 1.88517, 0.0394894, 0, 0.0597193, -0.210104, 1.14312, 0, 0, 0, 0, 1]}
        - !<FileTransform> {src: srgbf.spi1d, interpolation: linear}

the srgbf.spi1d was grabbed from Nuke’s OCIO config and placed in the ACES 1.2 config. The reason I did this is because Sapphire’s OCIO doesn’t allow you to manually select a config per effect instance so I couldn’t load both Nuke and ACES.

Oh wow, I just realized that the free OpenColorIO plugin also works in Premiere :smiley:
The plugin file needs to be in the common plugin folder to work.
Win: C:\Program Files\Adobe\Common\Plug-ins\7.0\MediaCore
Mac: don’t know and didn’t test yet.

This means we can have different configs and the plugin also already supports OCIOv2.

Some more playing around now that I have the free OCIO plugin running.
I checked out the not finished reference OCIOv2 ACES config and realized the RRT was split from the colorspace. This means that we can use the Display - sRGB as the input and go to Linear - sRGB within ACES. This totally removes the need for that sketchy setup I did adding a lut from Nuke’s config.

@Derek Don’t think there is a cleaner way to do it than this. But I don’t know when that config is going to be ready for public use. Btw I did have to add the Linear - sRGB colorspace to that config but I just picked it from Redshifts v2 config.

  - !<ColorSpace>
    name: scene-linear Rec.709-sRGB
    equalitygroup: ""
    bitdepth: 32f
    description: |
      Scene-linear Rec.709 or sRGB primaries
    isdata: false
    categories: [ file-io, working-space ]
    encoding: scene-linear
    to_scene_reference: !<MatrixTransform> {matrix: [ 0.439632981919, 0.382988698152, 0.177378319929, 0, 0.089776442959, 0.813439428749, 0.096784128292, 0, 0.017541170383, 0.111546553302, 0.870912276314, 0, 0, 0, 0, 1 ]}

Yay! That’s exciting!
Let me share where I’m at (and where I’m getting stuck) and hopefully together we can figure this out.

Both AE and Premiere are adding in a gamma 2.2 to EXR images, so the input color space needs to invert that. Here’s two color spaces that can do that for EXR files, one for AP0 and another for AP1:

EDIT: corrected to 2.4 gamma based @nick 's post below.

  - !<ColorSpace>
    name: Input - Premiere Pro - ACEScg
    family: Input/Generic
    equalitygroup: ""
    bitdepth: 32f
    description: ACEScg with gamma 2.4 for Premiere Pro
    isdata: false
    allocation: lg2
    allocationvars: [-8, 5, 0.00390625]
    to_reference: !<GroupTransform>
        - !<MatrixTransform> {matrix: [0.695452, 0.140679, 0.163869, 0, 0.0447946, 0.859671, 0.0955343, 0, -0.00552588, 0.00402521, 1.0015, 0, 0, 0, 0, 1]}
        - !<ExponentTransform> {value: [2.4, 2.4, 2.4, 1]}

  - !<ColorSpace>
    name: Input - Premiere Pro - ACES-2065-1
    family: Input/Generic
    equalitygroup: ""
    bitdepth: 32f
    description: ACEScg with gamma 2.4 for Premiere Pro
    isdata: false
    allocation: lg2
    allocationvars: [-8, 5, 0.00390625]
    to_reference: !<ExponentTransform> {value: [2.4, 2.4, 2.4, 1]}

With that in your config you choose the appropriate one as your input color space in the OCIO plugin. Here’s a screenshot of After Effects.

Note that I have the color depth set to 32 bits float in AE. To get this to work in Premiere I’d need to do the same. Is that possible? Here’s what I get with the same settings in Premiere. Note how the clouds are clipping because they have pixel values above 1 which are getting clipped.