EXR Linear Workflow Advice
I have started working with a 3D artist who supplies me with image sequences which have been generated by 3ds Max. These are EXR files (16bit / half float / gamma 1.0)
wish to adopt a linear workflow in After Effects and just wanted some clarification as to if this is correct or not.
My AE settings are as follows:
Preserve RGB: Unchecked
Assign Profile: sRGB
Interpret As Linear Light: On
Project Settings - Color Settings
Depth: 16 bits per channel
Working Space: sRGB
Linearize Working Space: Checked
Blend Colors Using 1.0 Gamma: Unchecked
Am I right in thinking that with this configuration I am working in a linear space but the colours displayed in the viewport or what I can exect to see when exporting to sRGB?
Thanks for your time
Hi Nick, in short, I would suggest other settings.
1) Just FYI: the term "linear light" or "scene linear" means the same thing as "Gamma 1.0".
2) EXRs are specified to be linear by default, with premultiplied alphas. You should see no difference if "interpret as linear light" is checked or not in the interpretation dialog — If you do, then there's a problem.
3) You *can* use the sRGB primaries as they are the same as Rec709 (sRGB was developed to copy the Rec709 primaries and white point), but it is actually more important to select the same primaries that your CG artist is using. If he is working with Rec709 primaries then fine but if he's using other primaries you should use those.
4) Linear space is unbounded, and as such you should remain in 32 bit floating point, not 16. Your working space color primaries can again be sRGB/Rec709, but really you should choose a "well behaved" profile with the primaries and white point that your artist used OR that you are going to export to. This may indeed be Rec709/sRGB.
5) It actually has no effect to have "blend using 1.0 gamma" checked or not. When you check "Linearize Workspace" you are setting the gamma to 1.0, and all math/blend operations will work in linear. The "blend using 1.0 gamma" option is for when you are NOT in linear space, but want to match the blend/opacity operations that were done in linear.
6) Most important: When you are working in linearized space you are essentially forced to use Adobe Color Management. This means you need to calibrate and PROPERLY PROFILE your viewing monitor. THEN when you select "display color management" AND set an output simulation for Rec709, you will be seeing what you will be outputting.
I recommend the XRITE i1 DISPLAY PRO for profiling your monitor.
7) The ProEXR plugins are helpful, especially if your animator is putting multiple layers into the EXR file. I believe they now come with After Effects, but if not you can download them free, and see the documentation at Fnord. https://www.fnordware.com/ProEXR/
Question: Is there a reason you are outputting to sRGB instead of Rec709? The only difference is the gamma curve, but it is an important difference...
VFX & Title Supervisor
Thank you for the prompt and detailed response.
As far as I understand the CG artist is working to sRGB. By this I mean he is using a calibrated monitor and his 3ds Max viewport is set to 2.2. Renders are displayed as 2.2 in the frame buffer (V-ray) but this can be switched to show the true 1.0 gamma by toggling the sRGB icon on the buffer. Does this make sense?
I actually switched my AE settings 'Interpret footage' to 'Preserve RGB - do not colour manage' for the image sequence and I can now observe what appears to be gamma 1.0 in the viewport and gamma 2.2 when I toggle 'linearize working space' in my project settings. This appears to produce the same results as when toggling sRGB in the frame buffer of the render. Does this sound right?
Is it preferable to have my AE as 32bit? I only ask this because the EXR's are only 16bit and I noticed that some effects do not function in a 32bit comp.
I have actually already calibrated my displays with an i1 Display Pro as you recommended.
To answer your question with regards to sRGB vs Rec709, I'm working to sRGB as final output will be for web only.
[Nick West] "Is it preferable to have my AE as 32bit? I only ask this because the EXR's are only 16bit and I noticed that some effects do not function in a 32bit comp."
Ae means something different by 16-bit than EXR does.
Ae uses integers to represent pixel values at the 8- and 16-bpc settings. That means that black happens at 0, and white happens at 255 (8bpc) or 32,768 (16bpc), and nothing can ever be darker or brighter. When you use 32bpc in Ae, it uses floating point numbers to represent pixel values. Black is 0.0, and white is 1.0, and you can represent colors darker than black and brighter than white.
So switching from 8bpc to 16bpc to 32bpc in Ae always gives you more precision, but 8bpc and 16bpc work in the same fundamental way (clipping extreme color values), while 32bpc works in a different way (allowing extreme color values).
In more practical terms, in floating poing (Ae's 32bpc), you can blow out the highlights with one effect, then restore them later with another effect. With the integer color depths (8 and 16), those blown highlights will not be recoverable.
The EXR format has the ability to use 16-bit "half float" floating point numbers. Black is 0.0, white is 1.0, and you can represent colors darker than black and brighter than white. It's less precise than full 32-bit floating point, but still fundamentally different than an integer-based color depth.
As you point out, there are a number of effects in Ae that do not support 32-bit, floating point processing. These still work in 32bpc comps, with the caveat that the 32bpc image is stepped down to 8 or 16bpc (whatever the effect allows), and will be processed at that integer-based color depth, then stepped back up to 32bpc for compositing or the next effect.
Values below 0.0 and above 1.0 will be clipped, and precision will be reduced. Use these effects sparingly, and consider using the HDR Compander effect when you need to preserve highlight detail. You'd compress the range before an integer effect and expand it afterwards.
TL;DR. Not all 16-bit modes are created equal. You should stick with 32bpc in Ae for CG comp to correctly handle values outside the normal range, and you should be careful when you use an 8-bit or 16-bit effect.
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter] | RenderBreak [blog] | Profile [LinkedIn]
Thanks Walter, that was very informative and now makes perfect sense as to why AE only lists 'float' next to 32bpc ..which was going to be my next question.
I'm now just trying to wrap my head around the 'Interpret footage' settings for my EXR sequences.
So far I have observed the following:
1 - When 'Preserve RGB (Disable CM)' is checked, my viewport appears to be displaying the image as 2.2
2 - When the above is unchecked but 'Interpret as Linear Light' is set to 'On' my viewport appears to still display as 2.2
3 - When 'Interpret as Linear Light' is set to 'Off' mu viewport appears to then display the base 1.0 gamma image
So my question here is what's the difference between options 1 and 2 or does it actuall make any difference when working in a linearized working space?
Nick said: As far as I understand the CG artist is working to sRGB. By this I mean he is using a calibrated monitor and his 3ds Max viewport is set to 2.2. Renders are displayed as 2.2 in the frame buffer (V-ray) but this can be switched to show the true 1.0 gamma by toggling the sRGB icon on the buffer. Does this make sense?
Okay, so we'll assume he's using Rec709/sRGB chromacities (this is common).
Nick said: I actually switched my AE settings 'Interpret footage' to 'Preserve RGB - do not colour manage' for the image sequence and I can now observe what appears to be gamma 1.0 in the viewport and gamma 2.2 when I toggle 'linearize working space' in my project settings. This appears to produce the same results as when toggling sRGB in the frame buffer of the render.
This was just for an experiment, yes? Based on this it sounds like things are in order. Just remember that you don't want to use "Preserve RGB", when working in linear you want color management on (and correctly interpreted) for all image items. Preserve RGB is really only for non-image items, such as motion vector maps.
The reason that you see gamma 2.2 when you switch to linear is because this tells Display Color Management to add the appropriate gamma curve to the feed to the display. This is why it's critical to profile the display.
(Note that you can work linear with color management completely off, but this involves setting up a LUT chain — using the CMM makes working with linear easier.)
Nick said: Is it preferable to have my AE as 32bit? I only ask this because the EXR's are only 16bit and I noticed that some effects do not function in a 32bit comp.
This is an apples/oranges thing. 16 bit in After Effects is actually 15 bit integer. 16 bit EXR is also known as "half float". It is a floating point encoding of image data. The difference between integer and floating point numbers is critical.
A problem with integer is that delta E errors increase as you increase the range of values - i.e. if you were to encode an HDR image of 30 stops in an integer format, the math "distance" between each color level would be both large, and fixed in spacing (relative to the gamma curve). the main noticeable artifact is that of "banding". In fact, a reason we use gamma curves in integer image formats is to compress the perceptual detail relative to vision, encoding more code values (i.e. color levels) in darker image areas. Even so the effective perceptual dynamic range in an 8 bit container is 6-8 stops, and in a 10 bit container really no more than 10-11 stops (a 10 bit DPX with LOG encoding uses about 90 code values per stop).
With a float however, these limitations vanish. Having a moveable decimal point means you can set a color level an arbitrary distance from it's nearest neighbor, eliminating problems like banding. Because Scene Linear means there is no gamma curve to compress darker image data, we need to be able to set each code value precisely.
16 bit half float in EXR gives us 1024 code values PER STOP, over a 30 stop range (plus an additional 10 stops at lower precision). You can even have negative (blacker than black) in addition to the very high overbrights. As such, when working in linear light, you *must* be in floating point. The key advantage of working in linear is that linear is how light works in the real world, so the math for linear operations like ADD work just like in real life.
In AE, the floating point working space is 32 bit. And it is advantageous to use a working space of a higher bit depth than your output space, as you will be then doing all the math of composition and adjustments at a higher precision, the same way it is best to edit a photo at 16 bit before creating an 8 bit jpeg.
Nick said: I have actually already calibrated my displays with an i1 Display Pro as you recommended.
Good that you profiled your monitor — that's one thing that trips up a lot of people when they start working in linear.
As for sRGB, that is still the standard for color on the web. Rec709 is the same except for the transfer curve (gamma).
To simplify your workflow, I suggest using a single profile for working space and output (so that you can export using working space in the output module - AE will automatically apply the gamma curve when you render to a non-floating point format.)
The specific sRGB profile I recommend is sRGB-elle-V4-srgbtrc.icc This is a V4 profile, it's using the correct transfer curve, and it uses parametric curves and not a table, which is preferable as a working space profile. There are many sRGB profiles floating around, and they are NOT all the same!!
VFX & Title Supervisor
Thanks again for such a detailed response Andrew. It is very much appreciated.
So just to confirm, when working in linear space ideally I should have my project depth as 32bpc float with an sRGB working space and 'Linearize' enabled. Am I correct in thinking that my 'Interpret Footage' settings should be as follows for my EXR sequences:
Preserve RGB - Unchecked
Assign Profile: sRGB
Interpret As Linear Light: On or On for 32bpc
Im guessing 'Assign Profile' won't actually do anything in this case as my working space is sRGB?
"Assign profile" relates to the profile used to interpret the footage, and is not related to the working space.
It works like this:
Let's say you're working space is DCI/P3. And then you import footage that you know is Rec709. You assign the Rec709 profile to the footage, then the CMM in AE maps those colors and whitepoint to the colors/WP in the DCI/P3 working space. The idea behind color management is that everything gets converted to a "same space" environment.
If the footage has an embedded profile (EXR, PNG, JPG often do), you should choose embedded. For footage that is Y'CrCb (422), AE forces it's interpretation based on what it reads in the header metadata (which is shockingly wrong a good percentage of the time). If you don't know what the profile is then make a guess (Rec709 works for most video for instance) and choose one that seems to interpret the footage close to how you want it to look.
In your case, since your CGI artist is rendering using Rec709/sRGB chromacities, you should choose those.
Example: Earlier this year I was working on a project and delivering EXRs with AlexaV3 chromacities. This is a wider gamut than sRGB. For the example image I just created below, I setup an sRGB linear working space, then interpreted the EXR of the test pattern in my slate as AlexaV3 (correct) or as the working sRGB space (wrong).
Notice the massive shift in saturation and hue. Everything is set to linear, so the visible change here is just due to the different x,y positions of the RGB primaries. Clearly using the correct profile that matches the imported footage is what's important.
AE Setup Best Practices:
1) Choose a "well behaved" RGB profile for the working space.
2) It is usually best when that working space profile has primaries that are the same (or very close to) the final output colorspace,
3) Work in linearized space as it is ideal for most compositing and other operations (except when you are generating graphics with an alpha channel that are going to be used in a gamma encoded space, such as a typical editing timeline, in this case it may be better to use a gamma encoded workspace).
4) Always use 32 bit float when working in linear. Use 16 or 32 bit for working in gamma encoded spaces.
5) Assign a a profile to the imported footage that matches the footage's primaries, whitepoint, and TRC (gamma).
6) All footage needs to be converted to the workspace gamma, meaning that gamma encoded footage needs to be converted to linear for linear workspaces.
7) When working in linear, DisplayColor Management is a necessity, as such the monitor must be properly profiled.
VFX & Title Supervisor
Perfect, thanks Andrew, I think I'm now on track!
Now for the next question, is it possible to export an image sequence and maintain the linear workflow or is the 'working space' always baked into the output?
Ideally I need to export an image sequence which maintains gamma 1.0 as I will be supplying this back to the 3D guy for him to use as a texture in his scene (extremely convoluted process, dont ask!)
So far I've only tried to output a TIFF sequence and it appears sRGB was backed into it.
With 8 and 16 bit Tiffs, AE is normally going to put a gamma curve on them (unless you select "preserve RGB"). 32 Bit Tiffs are float, and will keep the linear gamma.
Integer -> gamma encoded
You can output to 16 bit EXR, where AE will not add a gamma curve. Any integer output format AE will try and gamma encode relative to the working profile unless you select preserve RGB. But don't select Preserve RGB - your highlights will be severely clipped.
VFX & Title Supervisor
Thanks Andrew, for some reason I completely missed EXR in the list of formats, I must be going blind!
Looks like that's the way to go, but just out of interest is there any reason why I can't seem to find 'Preserve RGB' when selecting TIFF? I'm using Media Encoder so I'm thinking this might be a limitation and I would have to use AE's built in render queue dialog for this instead? ..either that or I'm looking right at it again.
Yes, "Preserve RGB" is a feature in AE. Media Encoder is more about rendering final compressed video for distribution or batch transcoding. Ive never considered using it for image sequences.
VFX & Title Supervisor
Got it, thanks again Andrew.
Here's a new one for you (it never ends!) I've just done a few final exports to h.264/MP4's via AME.
My exported files match up in various players (Windows 10 player, VLC, MPC etc) which is great, but one thing I did noticed was a very slight hue shift between my exported files and what I'm looking at in After Effects. It's subtle but its there.
I did a test with an sRGB image as my 'footage'. My AE project is setup for linear as we've discussed (32bpc, Linearize and Use Colour Management both enabled), I then exported to H.264 via AME and I can see the hue shift in the export across various players. I pulled the exported file back into AE and the shift doesnt appear to exist.
The only way I seem to be able to bring AE inline with my exported files is if to turn off 'Use Colour Management', disable 'Linearize working space' and change the Working Space profile from the stock sRGB oneto my monitor's calibrated profile. Once I do that the colours in AE are identical to those in VLC etc.
I can't quite get my head around what's actually happening here. Any ideas?
Based on what you described, I'm going to guess that your mp4 is at a resolution like 720x480 or smaller? (i.e. standard def size) ?? just a guess, but AME may be using the Rec601 colorspace, which uses very slightly different color primaries than Rec709 (which is what sRGB uses). I'm thinking this because Adobe seems to like to assign colorspaces based on
codec and/or resolution — and you'll notice that AME give you very few options regarding colorspace, OTHER THAN "NTSC or PAL". I find it interesting that "HDTV" is no where to be found inside AME.
Just as a point of reference, I NEVER EVER use AME straight out of After Effects. If I am going to use AME to create MP4s, I typically go out to ProRes, and then send that ProRes file into AME.
All that said, Adobe licenses "the guts" of what does all the work inside AME from MainConcept. You can read a sample of what the inner workings are capable of in this sample file here: https://www.mainconcept.com/us/getting-started/samples.html?item=1
As you can see, MainConcept can handle a lot of color spaces, but the HOST app needs to use the API to actually make things "go".
Does Adobe/After Effects send the correct source color information to AME when encoding though AME? I doubt it because Adobe does not even do that correctly in the AE output module !!!!!!!! (By "correctly" I mean not only transforming the color into the correct destination space but also setting the Atom/Headers in the output file to correctly reflect this with the proper FourCC code or profile information — color managed my axx LOL). I suppose Apple is partly to blame here for creating a media container (QT) that does not enforce listing colorspace information in metadata.
ALL THAT SAID: If you are going to be going out to "small" videos (SD NTSC) then you might want to use a Rec601 profile for the chromacities of your working space. It is my opinion that the best results are had when your working space chromacities are identical to your destination chromacities.
VFX & Title Supervisor