sobotka / filmic-blender

Film Emulsion-Like Camera Rendering Transforms for Blender
https://sobotka.github.io/filmic-blender/
2.07k stars 147 forks source link

Working Space #16

Closed MVARTZ closed 7 years ago

MVARTZ commented 7 years ago

When I used to import my exr files into AE, I'd set the project settings to 32 bpc (sRGB IEC61966-2.1) linearize working space. Because then the colors would match my render out of cycles. But what "working space" (At least I think that's what's it called) should I set it to? Anyone who could tell me, please?

MVARTZ commented 7 years ago

Oh I'm sorry. I'll delete this thread.

schroef commented 7 years ago

Well im wondering sort of the same. What happens to the image and color profile? I mean normally, most apps use sRGB. What is the color profile which is attached to Film Corrections when exported??

sobotka commented 7 years ago

This is a rather complex issues.

Adobe products are largely display referred. Working with scene referred content has been known to be quite challenging.

Resolve and Nuke will deal with the content gracefully, with the former requiring more experience. The latter has been scene referred forever.

I believe there is some toggle in AE for scene referred something, but no idea the contortions they are doing, nor if it is being done correctly.

OCIO enabled applications should all deal with it painlessly.

schroef commented 7 years ago

But what is the output for FIlmic BLender then. I mean every output image gets a profile. Is this then sRGB or some other format?

sobotka commented 7 years ago

There is no profile technically if you are operating on scene referred EXRs.

If you render out an aesthetic display referred image out of Blender to TIFF for example, it would be BT.709 primaries (the same primaries sRGB uses to define itself) and 2.2 power function, as that is the inherent baked in curve in your display. Elle Stone has an excellent 2.2 ICC for these purposes.

If you import an EXR to another application, the primaries are as above. If you import a Filmic Log Encoded image and properly transform it to linear, the ceiling value is around 16.291 scene referred (2^6.5 * 0.18).

To bake Filmic to an ICC curve, you would need to craft an ICC profile using the chosen transfer curve.

schroef commented 7 years ago

But isnt that weird then?! We use the Film toning and somewhere it becomes sRGB??!?! that's not right, atleast that doesn't sound right to me. I didn't read anything about that nor did i read anything about the best ouput file. When its output as EXR the colors will change again. im about 90% sure of that! Because the image becomes dark then and Filmic is off and cant be chosen. So i see some weird loop here. You say sRGB is bad and we must use Filmic, but for output we do need to put it in sRGB

Or do i need to use the display>none instead of the sRGB/BT709 PS where can i find good info what the difference is between display/screen scene. Im getting so confused by these terms.

sobotka commented 7 years ago

The primary lights in a scene referred model are what matter. The transfer curve and range are applied on the view only, up to the point of saving where it depends on file format and how an application lets you bake the transforms in.

So the moment that you save a TIFF from Blender, for example, is the moment that the image takes on the display referred state. Given that Blender doesn't use ICCs nor go near them, what you are seeing is a pure dump to a display with sRGB / BT.709 primaries.

Deep in the display's hardware, there typically is a DAC that applies a 2.2 power function correction to the data. As a result, if one were to attach a profile to their work to accurately represent a perfect 1:1 with what their display was showing them in a fully ICC colour managed system, they would need to attach an sRGB / BT.709 primaries ICC with a 2.2 transfer function. Elle Stone has provided such an ICC profile, as well as many more.

In Adobe products, in addition to being display referred, rely heavily on ICCs to do their colour management work. Working space needs to be set to a linearized sRGB / BT.709 set of primaries. The view control however, is in the display profile. This means to imitate what OCIO does, you would have to have an ICC for each of the View + Contrast looks. Even then, I am unsure how AE would deal with the scene referred values at the ICC output transform level.

It gets pretty sticky pretty quickly with Adobe products. Researching how AE uses the scene referred toggle might be a good starting point.

For further reading, the introductory PDF at http://cinematiccolor.com is solid. It is endorsed by the Visual Effects Society as well.

schroef commented 7 years ago

But when i turn of that sRGB profile FIlmic BLender is not available. Therefor isnt Filmic putout as sRGB to the display. Also when save its sRGB.

What happens if i use Filmic Blender but output a EXR image, what profile should be used for toning then?

sobotka commented 7 years ago

To start, these are very good questions. To answer them, we should avoid the sRGB term as it means three things, and for this discussion, we need to use specifics. sRGB is a colour space. As per the terminology laid out in the ISO 22028-1 Standard, a colour space represents three things:

So Filmic uses the same colour chromaticity for primaries and white point, but a very different set of transfer functions.

EXR, by convention when dealing with visual imagery, encodes without a transfer function. That is, the image data typically is assumed linear (although not always). In this case scene linear, or zero to theoretical infinity.

Hence when viewing the data, Filmic maps a particular range to the display referred range, and bends it nonlinearly. This isn't easy to accomplish with an ICC based system, as the ICC system was largely developed and became standard in display referred contexts such as graphic design. It binds the chromaticities, transfer function, total area coverage (TAC), black point compensation (BPC), and many other nuanced details under a single system.

OCIO on the other hand peels this apart into lower layers. You can control the transforms between chromaticities in isolation from transfer function, among other things.

So if you have a 32 bit EXR from an application and want to apply the transfer function from Filmic or ACES or Arri's K1S1 in an ICC system, you would need to develop a custom ICC to accomplish this, one for each combination.

This is a good read for more information on sRGB http://colour-science.org/posts/the-importance-of-terminology-and-srgb-uncertainty/

schroef commented 7 years ago

What's meant saying is, doesn't film run on sRGB icc cause when it's not selected for display mode. Filmic isn't selectable. I think then that it uses sRGB as output or isn't this the case.

sobotka commented 7 years ago

If I am understanding your question correctly, no.

sRGB's EOTF, or transfer function that gives the intensity nonlinearities to values, is not used anywhere. It is an entirely unique curve that maps a very different range of values.

The primaries are BT.709, which are the identical primaries sRGB uses.

So the encoded nonlinear values reference sRGB / BT.709 lights when you output to a display referred format such as TIFF, and the proper ICC profile to assign is a 2.2 power function due to the low level hardware of most displays.

If saving as an EXR, there is no transfer function applied, and the values remain scene referred linear. The primary lights are exactly as above; sRGB / BT.709.

cedricp commented 5 years ago

Hi, Just to be sure, if I'm working on a P3 color gamut display (with P3 display ODT), do I have to work with (linear) textures in this same color gamut ? Thank for clarifying this :) PS : Could you write a little doc to explain how you managed to compute these LUTs ?

sobotka commented 5 years ago

If you are on a Display P3 device, the reference space primaries don’t matter as long as they are properly converted to the Display P3 primaries at the end of the chain.

That is, your input could be Foo, your reference Bar, and your display Bing, and everything will be fine as long as Foo is converted to Bar for working, and then converted to Bing for display.

cedricp commented 5 years ago

Do you mean that I need to convert inputs (textures in my case) to what you call reference "Filmic Log encoding base" ? Sorry for the dumb question, but I'm pulling my hair out to get a clear explanation :) That sounds logic, ACES-cg working space seems to need ACES-cg textures to work properly...

sobotka commented 5 years ago

The “reference space” is the colour of lights that the math of mixing and rendering is being performed.

If our input image doesn’t have the same colours of lights, they must be transformed to have the same colours for each of the three lights.

Once the math is finished, the lights in the reference space remain the same, and simply must be transformed to the output display’s lights for viewing. This doesn’t change the light colours in the reference space, only how they appear on the display.

For Filmic, the reference space lights are REC.709. Once a render is finished, if you are viewing on a Display P3 monitor, the REC.709 lights are transformed to the Display P3 lights for proper viewing. This does not change the REC.709 based “sRGB” encoding of the image, but simply changes how they are viewed.

cedricp commented 5 years ago

For Filmic, the reference space lights are REC.709.

Ok, thank you for your patience ! If I want to work in P3 color space (light colors and image textures), will the Filmic work also, or do I need to make a new LUT ? (if so, how can I compute a new one ?)

sobotka commented 5 years ago

There's no way to work in Blender using a Display P3 set of primary lights as Cycles isn't colour managed.

cedricp commented 5 years ago

Not talking about Cycles, I'm trying to implement it in our in house rendering engine. I realize that I did not spend enough time about color pipeline (we're working in sRGB linear currently). So I started to study color science recently and I have to admit it's not as simple as I thought :) Do you have any (reliable) resource on the web about that ? Thank you for taking time reading me.

sobotka commented 5 years ago

If in-house, you take all of your inputs to the reference space. So in this case, all buffers must be converted to D65 REC.709. Textures normalized, emissions scene referred such as that from footage.

sobotka commented 5 years ago

This is probably best solved via instant messaging. Hit me up via email and we will see if we can get you sorted out.

cedricp commented 5 years ago

I think it's better indeed, thank you !