[Article Idea] Customize CLUT

#This post is a wiki post.
This means that anyone with trust level 2 or higher will be able to edit this post. If you have an idea or can take a minute to contribute to the contents, please do! (See the first response to this post.)

Customize CLUT – A bit like 3D curves.

Curves are one of the most versatile and often used tools for manipulating photos. The basic principle is that you can take an input value and map it to a new output value. Typically the user will set a few values to change and the software will interpolate a smooth, predicable change between the user set changes and all of the other values. Curves, however, are limited to one dimension. That is, you are only changing the intensity of one channel (eg red or green or blue).

Digital photographs are represented in three dimensions, each dimension is a colour channel and it forms a 3D cube of all of the possible colours in the image.

A Colour Look Up Table (CLUT) is list of all of the colours in a colour cube and new values that each colour should be changed to. Explain more here.

A Customize CLUT filter is available in G’MIC. It allows a full Colour Look Up Table to be made by specifying input and output, just like curves, but in three dimensions. It’s not complicated. It’s as easy as specifying an input colour you want to change and the colour you want it changed to. All of the other colour changes are interpolated from known points to produce smooth colour changes across the whole colour cube, just like the rest of the values are when using curves.

Lets look at an example. To keep it simple we will use a black and white image. If you set the input colour white to replaced in the output with black, and black to replaced in the output with white, all of the values in between are interpolated and you get a negative of what you started with.

We could replace white with cream and black with navy and get a split tone effect. Make sure your original image in GIMP is in RGB mode, not Greyscale, otherwise you will not see the effect.


To make things easier the filter allows you to ‘lock uniform sampling’ which has a number of options to make certain colours stay the same in the output unless you override them. If you set this to '8 keypoints (RGB corners) then the output image will match the input image.

Now here’s an example of changing a colour image. First we lock the 8 corner keypoints, then we replace red with blue and magenta with pale blue and the colour of the car is now blue.

The problem is that, with only a few keypoints specified other colours are changed as well. If we add more keypoints to lock colours so they aren’t effected, and a few more to make sure the colours we want changed are doing what we want, then we can get a much better result.

Here are the 14 points I used. Expand image to see all of them.

This is not the only way to change the colour of a car, and might not be the best way, but it is intended to illustrate the function and potential of the Customize CLUT filter.

Here is the source image if you want to try yourself

5 Likes

@Iain was kind enough to share what he’d written; I gave it its own wiki post here.

Good idea to make this an article (or a tutorial or…)!
I have just read it once, and what I miss is some “hands-on” examples, as well as an indication of what programs/tools/modules/apps/whatever would I need to perform this kind of witchcraft?

Sorry, it is from this thread, Sharing Galore and is the g’mic Custom CLUT.

For anyone that is at least Trust Level 2, you can click the “edit” icon at the top of the first post to be able to edit it:

Yes, this will be expanded further (and you can help!), but I posted it a 1:30 AM and didn’t have the energy to add an outline or anything to it. :grinning:

I added some images so the text hopefully makes more sense. Better images can be added once the text improves.

1 Like

Using this feature, would it be possible to have an easier way to achieve color curve matching?

1 Like

Hm, could it be that the two colors in the “Adjust Color Curves” image need to be swapped? I.e. the darker color becomes lighter? But I must be missing something…

I was just going to write the same kind of comment… usually in this kind of tools the horizontal axis shows the input color, and the vertical axis the output ones. A curve like the one shown in the “Adjust Color Curves” image makes the output lighter, so I agree that the text labels should be swapped.

Ah Fiddlesticks :confused:. I was not thinking straight.

Curves image should be fixed now

1 Like