I’ve opened a new feature request on GitHub… reading the comments on these 2 request… I think it might be non-trivial to get this one through. Color management is very tricky to discuss when not everyone is on the same page.
opened 10:30PM - 12 Dec 23 UTC
feature: enhancement
scope: UI
scope: image processing
**Is your feature request related to a problem? Please describe.**
Many film em… ulation 3D LUTs expect LOG encoded images on input.
Using 3DLUTs intended for LOG encoded images is impossible (or extremely tedious) out of the box in Darktable because DT doesn't have any tools built-in to convert from scene-referred linear to a known logarithmic format suitable for 3D LUTs.
Another issue is that the 3DLUT module has no feature to communicate how its output values are encoded to the rest of the pixel pipe when the 3DLUT modifies the encoding.
**Describe the solution you'd like**
### FEATURE 1 - ADD 'LOG' SHAPER CONVERSION ON 3DLUT INPUT ###
I would like to see common LOG formats added to the 'application color space' list in LUT3D.
This would make this feature behave like a true 'shaper' LUT to convert the scene-ref linear values (linear/rec2020 for example) into a 'log' format suitable for 3D LUTs.
Besides compatibility with existing 3DLUTs, using 'log' formats as 'shaper' LUTs enable the 3DLUT module to use highlight values well above the [0-1] range. None of the current 'application color spaces' enable retention of highlight values above 1.0.
Here's a suggested list of common 'log' formats that could be implemented:
- [ACEScc / AP1
](https://docs.acescentral.com/specifications/acescc/#acescc)
- [AlexaV3LogC/AlexaWideGamut](https://www.arri.com/resource/blob/31918/66f56e6abb6e5b6553929edf9aa7483e/2017-03-alexa-logc-curve-in-vfx-data.pdf)
- [Sony sLog3/sGamut3.cine](https://pro.sony/s3/cms-static-content/uploadfile/06/1237494271406.pdf)
- [RedLog3G10/RedWideGamut
](https://s3.amazonaws.com/red_3/downloads/other/white-papers/REDWIDEGAMUTRGB%20AND%20LOG3G10%20Rev-B.pdf)
- [Fuji F-Log2 / F-Log Gamut](https://fujifilm-x.com/global/support/download/lut/)
### FEATURE 2 - ADD USER DEFINED COLORSPACE METADATA ON OUTPUT ###
Add an extra 'output color space' menu to the LUT3D module.
This feature should not modify pixels in any way. Since .cube file metadata might be absent or unreliable, the user needs to be able to tell Darktable what encoding is expected at the output of the LUT3D module.
This would prevent downstream modules from double-converting values that are already encoded as sRGB by a tonemapping 3D LUT for example.
Adding these 2 features would enable custom tonemapping and film emulation options by using commercial and free 3D LUTs intended to be used on 'log' images.
This would also enable the possibility to use ACES display transforms for display compatibility with other ACES-aware software like Blender, Nuke, Krita, Davinci Resolve, etc... with minimal modifications to DT.
**Alternatives**
Currently the only way I have found to use 3DLUTs intended for LOG images in DT is to:
- Use the 'unbreak input profile' module to convert from scene-ref linear to a custom undocumented 'log' format.
- Use Davinci Resolve (or Nuke) to convert/bake my film emulation LUT into a format that expects the custom 'log' format created by the 'unbreak' module.
- Also include a useless sRGB-> linear conversion in the LUT since DT thinks the output of the 3DLUT module is still linear.
[See this thread for the entire discussion](https://discuss.pixls.us/t/linear-to-log-for-film-emulation-in-darktable-are-1d-luts-possible/40847/2) and detailed explanation of the current (clunky) workflow.
Another alternative solution might be to add 1D LUT support to the 3D LUT module. Currently, when using .cube files that include 1D LUTs, DT complains with this error: 1D cube LUT is not supported.
I think this is a less elegant solution since this will force users to modify 3DLUTs intended for log footage by adding a built-in shaper LUT using ociobakelut or some other 3rd party tool.
**Additional context**
[Here's a diagram](https://drive.google.com/file/d/1FlS7e4rForuToD4NIV1aFiFbN_xvMQ2a/view?usp=drive_link) that explains the desired complete workflow:
![film_emulation_workflow](https://github.com/darktable-org/darktable/assets/96096771/7a645b56-76e5-43c3-8650-80322f48b453)
The new features requested would enable the LUT3D module to take care of the 'shaper' and 'film emulation/tonemap' in a user friendly way.