Camera Raw and Lightroom: Document the format of RGB LUTs in enhanced profiles

  • 8
  • Idea
  • Updated 3 months ago
If Adobe documents the format of RGB LUTs stored in enhanced profiles, then it will be straightforward for LR plugins to make it much easier for users to import video LUTs as enhanced profiles and apply them to their images. 

There are hundreds, perhaps thousands, of existing LUTs, primarily used for video editing, and most of those are in Rec 709.  There are several roadblocks to users wanting to use those LUTs in LR:

- Camera Raw doesn't allow the Rec 709 gamma 2.2 and 2.4 color spaces when importing a LUT into a new enhanced profile:
https://feedback.photoshop.com/photoshop_family/topics/camera-raw-add-rec-709-to-lut-color-spaces-in...

- A user would need to buy an expensive utility to convert Rec 709 LUTs to a supported color space (e.g. ProPhoto RGB or Rec 2020).

- While LR 7 users will have access to Camera Raw via Photoshop (included in their CC subscription), many of them are unfamiliar with Camera Raw and would find the steps for creating enhanced profiles obscure and daunting.

--------------------------------------
My current surmise for how the LUTs are encoded:

- The LUT is converted to the internal LR/ACR working space (ProPhoto RGB primaries and white point, linear transfer function).

- It is compressed somehow. 

- The compressed LUT is then encoded using a minor variant of Ascii85.
Photo of John R. Ellis

John R. Ellis, Champion

  • 3736 Posts
  • 977 Reply Likes

Posted 5 months ago

  • 8
Photo of Cameron Rad

Cameron Rad

  • 67 Posts
  • 9 Reply Likes
It's an Iridas/Adobe Cube LUT with no blank lines in the header of it.

The LUT works in the working space defined when creating the enhanced camera profile.

For instance if you want to use a Rec.709/2.4 LUT. You could select sRGB when creating the enhanced camera profile and use a LUT that goes sRGB > Rec709/2.4 > Look/Style > Rec709/2.4 > sRGB.

Or if you wished to used AdobeRGB. AdobeRGB > Rec709/2.4 > Rec709 Film Emulation LUT> Rec709/2.4 > Adobe RGB

It should be mentioned that any LUTs meant to work on Rec709/2.2 images should work with no issues on sRGB images. Rec709 and sRGB share the same primaries and white point and sRGB is close enough to 2.2 gamma
(Edited)
Photo of John R. Ellis

John R. Ellis, Champion

  • 3676 Posts
  • 961 Reply Likes
"Rec709 and sRGB share the same primaries and white point and sRGB is close enough to 2.2 gamma"

But most available color-grading LUTs are Rec 709 gamma 2.4, corresponding to the default color spaces of the Premiere Pro and Resolve 12.5 project timelines.   The difference between 2.4 and sRGB's average gamma of 2.2 can be sometimes quite noticeable, especially in the shadows.
Photo of Cameron Rad

Cameron Rad

  • 67 Posts
  • 9 Reply Likes
It should be mentioned that any LUTs meant to work on Rec709/2.2 images
I specified the gamma in my comment in terms of Rec709. If a LUT was meant to work on Rec. 709/Gamma 2.2

I also shared a workflow for using Rec709/2.4 LUTs.
However it requires a transformation within the LUT from sRGB to 2.4 and back.

An easy way to do that without extra software is to combine and generate a new LUT in Photoshop by using the Color Lookup Adjustment Layers  and File > Export > Color Lookup Tables.

You can use these 1D transformation LUTs I generated to go from sRGB to 2.4 and vice versa.
https://www.dropbox.com/s/wupezb4v75irsj0/sRGB%20Rec709%20Transformation%20LUTs.zip?dl=0  

If you have a LUT requiring Rec.709/2.4, place it between the sRGB>2.4 LUT and the 2.4>sRGB LUT and export a new LUT out of Photoshop.

Or if you just want an approximate match, you can use two exposure adjustment layers to apply a 1.091 gamma correction and a 0.917 gamma correction.
Photo of Cameron Rad

Cameron Rad

  • 67 Posts
  • 9 Reply Likes
What I would like is an Adobe Linear profile to use a base. A lot of LUTs may have their own built in Tone Curve which is meant to apply to linear images. I can work around this by making my own Linear DCP or using certain base settings in ACR or trying to reverse the acr default curve in my LUTs. However it would be a bit easier if there was an Adobe Linear profile built in. 
(Edited)
Photo of DP HOME

DP HOME

  • 64 Posts
  • 9 Reply Likes
define "Adobe Linear" vs "Adobe Standard" ... so Adobe shall create one more profile for each camera model ? how it shall be designed ? as dual illuminant pure matrix profile + linear curve inside and no other LUTs ?
(Edited)
Photo of Cameron Rad

Cameron Rad

  • 67 Posts
  • 9 Reply Likes
Just Adobe Standard without the default tone curve enabled. A linear one.  Linear + whatever file encoding gamma. I guess technically that'd be display linear, since scene linear would also require a gamma 1.0 icc. 

Right now you can open DNG Profile Editor and see the base curve applied. Or you could change the process version and 0 out the numbers. 

Just something so I don't have to use a workaround like custom DCP profile or base settings or inverse curve in a LUT to get back to a linear response rendering. I do this already and it's just a minor inconvenience, but it would help for those would who request a linear curve other reasons as well, such as flat artwork (although they should be making custom ones)

The ACR default tone curve is similar to this I believe:

(Edited)
Photo of Cameron Rad

Cameron Rad

  • 67 Posts
  • 9 Reply Likes
I've posted this before, hopefully adobe will see it

In the creation of the Enhanced Color Profiles, I'd like to see a couple more options in regards to LUTs.
Ideally I'd like it to be a bit more similar to the Color Space Converter in After Effects. Or similar to OCIO

For color space it should have two parameters, not one.  Input Color Space/Output Color Space.

Input color space refers to the RGB values being sent into the LUT.  (Out of ACR/LR)

Output would refer to how to interpret the RGB numbers being sent out from the LUT. (Back into ACR/LR)

Have a drop down menu for both options with a list of common spaces as well as an option for "Custom" which would allow user to define some custom parameters like Primaries/White Point/Gamma-ToneCurve. 

Some common input spaces could include:

Arri Wide Gamut/Arri LogC
Rec709/Cineon Log
Rec709/sRGB
Rec709/Gamma 2.2
Rec709/Gamma 2.4
Rec709/Rec709 Gamma
P3D65/Gamma 2.6
P3D60/Gamma 2.6
P3D65/sRGB (DisplayP3)
ACESCG/Gamma 1.0
ProphotoRGB/Gamma 1.0
ProphotoRGB/Gamma 1.8


Some common output spaces could include: 

AdobeRGB/Gamma 2.2
Rec709/sRGB
Rec709/Gamma 2.4
Rec709/Gamma 2.2
Rec2020/Gamma 2.4
P3D65/Gamma 2.6
P3DCI/Gamma 2.6
P3D60/Gamma 2.6
P3D65/sRGB (DisplayP3)
ProphotoRGB/Gamma 1.8
(Edited)
Photo of John R. Ellis

John R. Ellis, Champion

  • 3736 Posts
  • 977 Reply Likes
"It's an Iridas/Adobe Cube LUT with no blank lines in the header of it."

That's the format of cubes loaded as an input Color Lookup Table in the New Profile window of Camera Raw.

I'm asking for something different, the format of the LUT after it is encoded and stored in the .xmp file.  It looks like this: 



As I described above, If Adobe discloses this encoding, then a plugin can construct LUT-containing enhanced profiles on its own, with two benefits:

- A plugin will make it easier for average LR users to apply LUTs to images without needing to learn how to construct enhanced profiles in Camera Raw, with which they aren't familiar.

- A plugin will allow the use of arbitrary input and output color spaces by converting the supplied .cube into the internal working color space used by Camera Raw. The average user is most interested in the color grading LUTs in Rec 709, but that are obviously many users like yourself interested in other color spaces.
Photo of Cameron Rad

Cameron Rad

  • 67 Posts
  • 9 Reply Likes
Ah yea, that encoding.

I think a LUT Panel under the Camera Calibration panel would be nice. I think make it similar to Color Profile Converter Adjustment Layer in After Effects with parameters for input/output space.  Or OCIO would be great. It can have a basic and advanced mode for different level users. 

I'm curious if the LUT info is included in the metadata uploaded with JPEGs if you embed metadata. It would suck to develop a nice LUT for color grading only to have it swiped because you forgot to strip exif. 
(Edited)
Photo of Cameron Rad

Cameron Rad

  • 67 Posts
  • 9 Reply Likes
Here's an example round trip I've used.

I select ProphotoRGB when creating enhanced camera profiles, that way no clipping is done.

I then create a LUT which converts ProphotoRGB/Gamma 1.8 data into Rec709/Cineon Log data. I combine that transformation LUT with a LUT that transforms Rec709/Cineon footage to a Print Film Emulation meant to be viewed on a P3/2.6 monitor.

I then convert the result from P3/2.6 space back into the ProphotoRGB/1.8 working space.

The final LUT contains:
Prophoto/1.8 > Rec709/Cineon > Print Film Emulation/P3 > Prophoto/1.8

Result:

Adobe Color


Test Profile:
(Edited)
Photo of John R. Ellis

John R. Ellis, Champion

  • 3736 Posts
  • 977 Reply Likes
"I'm curious if the LUT info is included in the metadata uploaded with JPEGs if you embed metadata."

I just checked, and the metadata includes the name of the profile, its unique identifier, and the unique identifier assigned to the LUT, but not the contents of the LUT.
Photo of Federico Bianco Prevot

Federico Bianco Prevot

  • 1 Post
  • 0 Reply Likes
The LUT data seems to be stored using a custom Base85/Ascii85 encoding that doesn't use XML characters on top of some sort of variable length compression.Wanting to convert my dozens and dozens of LUTs, knowing this encoding is the only think blocking me for automating the process. 
Photo of John R. Ellis

John R. Ellis, Champion

  • 3736 Posts
  • 977 Reply Likes
See this related request to document the encoding of the look tables (hue-saturation maps): https://feedback.photoshop.com/photoshop_family/topics/enhanced-profile-issue-csv-looktable-files-wi...