GIMP - How to apply 3D LUT?

@David_Tschumperle the speed with which you pump out new awesome plugins is astounding!

2 Likes

It worked perfectly! After this suggestion, it took not more than a couple of hours to get a first test filter running. So here is a .cube LUT applied directly on a processed RAW file, using PhF+Gā€™MIC:

There is however quite some work still needed to make a fully functional filterā€¦ for example, one aspect that needs to be taken into account is color management: many of those ā€œlookā€ CLUTS require pixels in a specific colorspace, which in many cases is different from sRGB, so some ad-hoc ICC conversion is needed to obtain the exact output expected from the CLUTs.

But the bulk of the job is now done, thanks to Gā€™MIC! :smiley:

This filter is great! :grinning:

It takes a little bit of getting used to but once you do it is very powerful.

I have a couple of suggestions:

  1. For each source/target pair it would be nice to have a switch to lock the source color in place. For example if I want to protect skin tones I have to enter the same color in the source and target color selectors, which is a bit fiddly. Unfortunately this will clutter the UI, so it might make it less usable in the end!

  2. I think it would be good for the user entered keypoints have priority over the ā€˜lock uniform samplingā€™ points. If I lock the RGB corners and then I want to adjust one or two corners I have to make points very close to the corners and adjust them. It was a little confusing to try to adjust pure white and nothing happened.

Also, if you are not busy (huh!) an interactive version where you click the image and then can manipulate the color of the selected point in the CLUT would be amazing.

Edit: Just had a play with this on a color checker chart. The results look okay.

2 Likes

I also thought about an interactive version. For example as it is in ā€œICC3Dā€ (Interactive Color Correction in 3 Dimensions). It is not FOSS, but I point to it as an example.

It is a computer program from The Norwegian Colour and Visual Computing Laboratory, Department of Computer Science and Media Technology, NTNU in GjĆøvik. With this software you can visualise images in different 3D color spaces and interactive manipulate this color space. The Java software is at start a bit difficult to understand. After you load an image, you have to click on ā€œView 3Dā€ in the image-window. Then you will see a representation from this image in LAB color space. But you can also use other color spaces.

The representation is Quantized with ā€œpointsā€. You can interactive manipulate this points. Add the module ā€œImage gamutā€ to alter the Quantization.

I could not find a user manual for this software. So you have to experiment. But maybe this can be an example for the manipulation of points in a CLUT.

Paper for ā€œICC3Dā€:
http://www.colorlab.no/content/download/28954/331063/file/Farup2002.pdf

Here is the website with ā€œICC3Dā€:
http://www.colorlab.no/research_and_development/software

Honestly, coding an interactive 3d clut manipulation is not in my plans :slight_smile: Itā€™s a really big amount of work.
But, Iā€™m preparing some advanced 3D CLUT preview for the filter, this should be enough I think.

Version 3 of this filter is now available :slight_smile:
It includes more advanced options, as well as a useful 3D visualization tool for the CLUT.

4 Likes

This is amazing! :smile:

2 Likes

@David_Tschumperle, Maybe I am asking too much, please then forgive me. The science for this awesome stuff is realy beyond my knowledge. Despite my lack of expertise, new ideas are popping up continuously in my mind.

Now you can replace source colors with target colors. Then there is interpolation with ā€œ3d solidifyā€. Is that correct?

Would it be possible to replace a source part of the color spectrum with a target part of the color spectrum?

@iarga, no problem, any idea is good to take. As long as Iā€™ve the choice to choose which idea seems doable in a fairly quick time :slight_smile:

Iā€™m not sure I understand your concern. The interpolation makes actually a lot of more or less wide range of colors changing to another range of colors, so it already matches one RGB region with another one.

I think I understand it a little bit. With 8 keypoints this range is wider then with more keypoints. Also you can change the keypoint influence.

To make my question more clear: ā€œIs there another way to have influence on the wideness of this range of colors changing to another range of colors?ā€ I would like to have the possibility to change the wideness of this range, for each color seperately.

edit: So I am asking to have more influence on this interpolation for seperate source colors and target colors.

From what I see when playing with the filter, it is really interesting to add several keypoints in the ā€˜lock modeā€™ (thanks for that wonderful idea @Iain!) , close to the color youā€™ve changed, to limit the range of a transformation for a single color.
For instance, Iā€™ve been able to change only the background color on this example, while keeping the skin mostly unchanged :

Many keypoints around skin colors have been set in ā€˜lock modeā€™, while the keypoints around the green are in ā€˜replaceā€™ mode.

2 Likes

Are there also ways to extend the range of a transformation for a single color?

Well, in a sense yes, you just have to avoid placing keypoints around.

1 Like

You can add several key points throughout the range of tones you want to change and set them to the same or similar target colours

Eg orange to green and yellow to green

1 Like

You understand me exactly. But I am a little bit lazy. So instead of several keypoints, I thought about one range you could set with sliders. So you could choose a start point and end point on a slider. A little bit like setting a range in LightZone (there you choose a color and set a range for light values) or like ā€œRotate Coloursā€ in GIMP, altough the last isnā€™t with sliders but with two clocks, because of the continuity of the color spectrum.

ā€œMyā€ sliders would definitely clutter the whole UI. :smile:

Defining an entire closed region in a space like RGB with slidersā€¦ well, Good luck :slight_smile:

1 Like

Thank you for your patience. I begin to understand the complexity.

Now Iā€™m in the LUT mode too. Iā€™ve googled a little bit about LUT tables and found this tool. It has some really nice tools, perhaps someone is interested in copying them. :wink:

http://3dlutcreator.com/

Why not buy it? Iā€™m sure Oleg Sharonov will appreciate that. But maybe you could friendly ask him to make a FOSS-plugin for gimp? :wink:

Why not buy it?

  1. It doesnā€™t run on Linux.
  2. I only use FOSS.
  3. I donā€™t need it, I would only play with it.
1 Like