Modules that should be placed between the input and output color profiles....in Darktable

I know that there is currently a lot of work going on to try to resolve the backward compatibility with older edits and history issues. The changes allowing module reordering and the introduction of new modules with a new order of iop / pixelpipe order version have produced some weird results as of late. I was wondering if anyone is aware of a list of modules that should be between the input and output profiles or for that matter in any required order. I am asking for 2 reasons in @anon41087856 latest video on the new filmic he was rearranging modules to get the correct orderā€¦it would be nice to know any hard and fast rules that should be followedā€¦and the second related reason is that I recently applied the Kodak Ektachrome preset in the Color balance module to a few of my images and I really liked the look it produced however tonight I went back to some images that I edited a month ago on an earlier build of Darktable and I tried to add this module. My images were completely corrupted and I noticed that the color balance module was inserted so that it was being applied before the input color profile. I just without any real knowledge dragged it above the input color profile and my images looked amazing. I think maybe even better than I had noticed using that preset before. So clearly there are some issues in place at times with some older edits and clearly the order of execution can have dramatic consequencesā€¦in any case just sharing my experience and if anyone has anything to add or comments they would be appreciatedā€¦Thanks

1 Like

This is what happened when I added the color balance presetā€¦

and just dragging it up restored the image with the desired effectsā€¦

Generally speaking, any luminance/chrominance operations should be done between input and output color profiles. Only operations like crop and rotate, and perspective correction can be done either before input color profile or after output color profile.

Take a look to the top of this link, is very well explained.
https://github.com/darktable-org/darktable/pull/2905

Also :

https://github.com/darktable-org/darktable/pull/3075#issuecomment-538410131

Lut3d module has 2 intrinsic limitations. One comes from its property to be able to apply non linear and non formula operations. The second one is that the module clamps the signal values to [0,1] (because interpolation works only between these limits).

For these reasons it seems to me Lut3d still comes a bit early in the pipe. Would not it be safer to place it closer to colorout ?

@anon41087856 @dcen @msd Thanks for providing that infoā€¦tucked it away for future referenceā€¦

Everything in the pipe implicitely expects values between [0;1]. Not that all modules clip the signal, but the UI controls donā€™t allow you to set parameters past 255 ; 100% ; 1.0 (parametric blending, color zones, curves, etc.). Thus, any signal past 100% display-referred canā€™t be adjusted anyway (it will take the extrapolated correction of the last before 100).

To avoid clipping in LUT3D, I think the best way is to rescale the signal to [0; 1] with the exposure module, then scale it back after LUT3D if needed (create a new instance of exposure module, drag and drop it after LUT3D).

The reason it comes that early is the usual workflow (AFAIK) of colourists is to use the LUT as a first fast approach to grade images, then refine it a bit if needed. Moreover, in a batch editing setup, you want all the profiled things to come first (because profile are hard-set), then add the case-by-case sweeteners at the end for fine-tuning.

Thereā€˜re different usecases for LUTs.

  • Bring log material into a proper color space ā€”> this should be done early in the pipe
  • Creating a specific look ā€”> this should be done late in the pipe since these LUTs requires a proper exposed and whitebalanced image to achieve the intended result.
  • and many cases inbetween :wink:

So unfortunately thereā€™s no one size fits all solution in a fixed pipe. Itā€™s important, that the user of LUTs is aware of the use case and replace LUT modules in the pixel pipe according to the intended behavior.

2 Likes