GIMP - How to apply 3D LUT?

Is the extension of the file .cube ? Otherwise it will try to load it as a regular image.
Could you send me the file by email ?

Yes, extension == .cube
e-mail sent.

Thanks @Claes, I’ve been able to fix the bug, at least with the file you sent.
Just press the Update Filter button, it should work now.
Thanks a lot ! :wink:

Bingo! It works - just as expected ? :slight_smile:

Salut! More .cube found for you to play with:

It seems to work with these too.

I was wondering if it would be possible for a filter in the GIMP plugin to create your own CLUTs. I imagine it as, say, 20 colour selectors that allow you to set the input colour and the output colour and the rest of the CLUT is interpolated with the 3d solidify command.

Is is possible?

3 Likes

Yes that is possible. Good idea indeed !
Any idea about additional options you’d like to see for such a filter ?

2 Likes

All I can think of at the moment is

The ability to lock a) the corners of the color cube and/or b) neutral grey, black, and white ,so you don’t have to use limited number of color inputs/outputs available for that.

And the ability to apply, save, and load CLUTs

OK, here is a first attempt, available after a filter update.
Filter Colors / Customized CLUT:

It looks already quite useful to me. Let me know about what you think about it !

4 Likes

Is there a possibility for a slider for regularization?

I think this filter is already a gem, thank you very much Iain for your idea and David for the filter. Also I thank others here to start this topic.

@David_Tschumperle Hi David, I’m also very thankful for this impressive work on CLUTs! I have started to write an interface for the Film emulation/User-defined filter in PhotoFlow, to be able to load and apply .cube LUTs.

The code works correctly, but it is currently very slow due to the way PhF and G’MIC interact. As you might remember, PhF handles itself the tile processing parallelisation, and separate gmic instances are created for each processing thread in order to avoid race conditions. The desired gmic command is the applied to each tile via gmic::run().

The problem with the .cube LUTs is that the parsing and conversion of the LUTs are performed at each call to gmic::run(), and therefore for each processed tile, which makes the processing very slow.

Would there be any possibility to cache the converted .cube LUT, so that the conversion is performed only once? For example, the caching could be tied to the LUT filename, and the cached LUT discarded whenever a new filename is passed to the -input_cube command?

Thanks a lot!

1 Like

Second version of the filter, with more controls for constraining the clut, as well as a regularization slider :slight_smile:

This filter is definitely cool !!

3 Likes

@Carmelo_DrRaw . Hi Andrea,
Actually, a good idea would be to convert first the .cube file into an HaldCLUT, like this :

$ gmic -input_cube ~/Downloads/NightFromDay2.cube -r 64,64,64,3,3 -r 512,512,1,3,-1 -o haldclut.png

Then use it as a classical HaldCLUT transformation.
Do you think this could work for you ?

1 Like

@David_Tschumperle , does the regularization in this new filter works like the same as the regularization in your “Selective desaturation” filter? It looks like this kind of regularization is different. I would like it was working as in your “Selective desaturation” filter, is that is possible?

But keep also this spatial-regularization, that’s also cool.

Well, I’ve tried to make it more similar. But the problem is not the same, so it won’t behave exactly the same.

I can imagine the problem is not similar. But I know you are clever. :slight_smile: So there was maybe a possibility. Thank you very much. :wink:

edit: I now see the change. Yes this is more as I had suspected, it is more similar.

Hi David, that’s already a big step forward! The HaldCLUTs are also loaded
at each tile processing, but that is considerably faster.

Are the parameters of the -r commands in your conversion example valid for
all .cube LUTs?

Thanks a lot!

Andrea, another solution is to load the CLUT data once and pass it to the G’MIC parser along with the image data you want to process, as a shared data.
This should be as simple as this :

2 Likes