It is currently 30 May 2020, 11:07

• Featuring Members' Works (Image Attachments) •
1: member
2: member
3: member
4: member
5: member

GIMP/GL:  🡆 Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Getting your feet wet with CLUTs (color look-up tables)

GIMP Tutorials
Forum rules
Tutorials must be created by you and your own idea.
If you got idea from elsewhere and revised your own version of tutorial, please include reference and credit original authors.
For example if you found a Photoshop tutorial and wanted to write a GIMP version, you must credit the original Photoshop tutorial.
Post Reply
neurolurker
Forum Member

Getting your feet wet with CLUTs (color look-up tables)

Post#1 by neurolurker » 24 May 2019, 21:25


Windows 10. GIMP 2.10.10. G'MIC 2.6.2.

These CLUTs are in every way more down-to-earth than the one included in the Galaxy NGC-156 Revisited post. Since that one is such an exaggerated example, this post offers a look at more realistic photo enhancement effects.

It's useful to have a test image. Something that already is or becomes familier so you are more likely to notice subtler changes. This one is a web-size small PNG in case anyone would like to use it.
CLUT TEST GIMP LEARN 122956 CLRs.png
CLUT TEST GIMP LEARN 122956 CLRs.png (404.36 KiB) Viewed 5084 times

A visible-color spectrum; underneath is the spectrum desaturated and under that is an RGB 0 to 255 stepped grayscale. The grayscales help show highlight and shadow overloads as well as what the grays have been changed into by the CLUT. Middle is a generic landscape snapshot. Right, an increasingly famous face from Unsplash. A CLUT that works well on a landscape may not work at all on a portrait.

To apply the CLUTs below to an image in GIMP, download them from this post; save them where you can find them; they don't have to go in a GIMP-specific folder.

Open an image. Click on Filters: G'MIC. Open the "Colors: Apply External CLUT" function. You'll see a preview warning since no CLUT has been selected. Find the HaldCLUT Filename button. (Nevermind right now why it's called that.) Clickit. Navigate to your CLUT. Select and open.

Whatever appears in the preview now ... you can further change with the Apply External CLUT options.

To try another clut, first clear the preview with the green arrows near the top of the plug-in panel.

When you get an effect you like, click OK to apply the CLUT to your target image, and this takes the focus back to the main GIMP workspace.


The CLUTs included here are 64x64 px PNGs. CLUTs have to be specific sizes and are usually 64x64 or 512x512 or 1728x1728 to accommodate different target precision. Since the CLUT file has be in an uncompressed format, the larger its dimensions, the larger the file. This could become an issue on smaller systems. A 1728 CLUT is about 8.5 MBs.

CLUT-file colors are arranged in a specific order and the apps that apply CLUTs can interpolate colors that are not actually in the CLUT-file itself. Unlike INDEXING an image, a 64x64 CLUT with 1292 unique colors and less than 400 bytes does not reduce the target image to its own limited number of colors. The number of unique colors in the target image may increase or decrease. In a hobbiest situation, depending on what target you're working with, using a larger CLUT file may not give appreciably better results than a smaller one.

==================================================================

64 CLR POP.png
64 CLR POP.png (7.93 KiB) Viewed 5084 times
CLUT TEST GIMP LEARN  - CLR POP.jpg
CLUT TEST GIMP LEARN - CLR POP.jpg (53.3 KiB) Viewed 5084 times
If memory serves, I got the first version of 64 COLOR POP with the freeware IRFANVIEW application for use in its FILM EMULATION plug-in. This was where I first became aware of CLUTs. You could apply pre-existing CLUTs with IV, but you couldn't directly create your own CLUT from a non-CLUT image. And that's where I first became aware of GIMP, where you can directly create CLUTs from any other image. (We can talk about this after the show.)

==================================================================

64 YUV POL.png
64 YUV POL.png (5.17 KiB) Viewed 5084 times
CLUT TEST GIMP LEARN - YUV POL.jpg
CLUT TEST GIMP LEARN - YUV POL.jpg (56.22 KiB) Viewed 5084 times

I made 64 YUV POL from a plug-in filter in my 2002 Model-T version of Photoshop. I was trying to find an RGB polarizing filter effect but the only formula I could find was for YUV. This one puts in yellows that CLR POP browns out.

==================================================================

64 FUJI VELVIA GENERIC.png
64 FUJI VELVIA GENERIC.png (4.52 KiB) Viewed 5084 times
CLUT TEST GIMP LEARN - FUJI VELVIA GENERIC.jpg
CLUT TEST GIMP LEARN - FUJI VELVIA GENERIC.jpg (57.63 KiB) Viewed 5084 times

64 FUJI VELVIA GENERIC is a film emulation example. I've never owned anything except consumer snapshot cameras and Polaroids. I bought my first digital camera in 1998 and haven't used film since. So the technical aspects of CLUT film emulation is, I say to my shame, pretty much lost on me. As I "auditioned" the film emulation CLUTs I found on the web, there were some that really stood out. For me, this was one of those. It really needs a larger showcase than the example above.

=================================================================

64 MUTE MIDTONES.png
64 MUTE MIDTONES.png (5.63 KiB) Viewed 5084 times
CLUT TEST GIMP LEARN - MUTE MIDTONEs.jpg
CLUT TEST GIMP LEARN - MUTE MIDTONEs.jpg (49.15 KiB) Viewed 5084 times

The first three CLUTS generally brighten colors. 64 MUTE MIDTONEs dials them down.

=================================================================

64 PSEUDOGRAY.png
64 PSEUDOGRAY.png (12.14 KiB) Viewed 5084 times
CLUT TEST GIMP LEARN - PSEUDOGRAY.jpg
CLUT TEST GIMP LEARN - PSEUDOGRAY.jpg (46.63 KiB) Viewed 5084 times

Strictly speaking, 64 PSEUDOGRAY should probably be called Faux-Pseudo-Gray. An RGB image looks like regular black-and-white but is not indexed down to 255 colors. The PNG of the example (not included) has 1493 colors; the compressed JPG shown here has 353 colors. Generally, of course, with more colors you can do more things.

=================================================================

64 CERN WINTER MOUNTAIN.png
64 CERN WINTER MOUNTAIN.png (12.14 KiB) Viewed 5084 times
CLUT TEST GIMP LEARN - CERN WINTER MOUNTAIN.jpg
CLUT TEST GIMP LEARN - CERN WINTER MOUNTAIN.jpg (50.82 KiB) Viewed 5084 times

64 CERN WINTER MOUNTAIN was made from an image of the CERN thing processed with an image of a pallete-knife painting that actually looked like a photograph of a mountain. An amazing painting. The effect of the CLUT is to let stand some of the blues of the target and turn nearly everything else gray. Similar CLUTS can gray out everything but the reds or greens.

=================================================================

64 RUST PSDG JAPANESE LIGHTEN x3.png
64 RUST PSDG JAPANESE LIGHTEN x3.png (12.14 KiB) Viewed 5084 times
CLUT TEST GIMP LEARN - RUST PSDG JAPANESE LIGHTEN <a href='/to-postnum.php?p=26562&t=2399&pn=3' title='Goto post #3'>#3</a>.jpg
CLUT TEST GIMP LEARN - RUST PSDG JAPANESE LIGHTEN #3.jpg (51.49 KiB) Viewed 5084 times

I try to name my CLUTs with clues to how I ended up with them but with 64 RUST PSDG JAPANESE LIGHTEN x3 you probably don't wanna know. It's a sort of corroded sepia effect rather than the usual monotone tabac effect. For a brief episode of pseudo-time-travel, don't apply it to a picture of an old dilapidated barn. The genuine sepias would only have been of new barns; no one would have wasted plates or film and chemicals on an unsellable picture of an old barn. Apply this one to a selfie.

==================================================================

And if you've gotten this far and your feet aren't as wet as you'd like, let me inform you as an added bonus that there are several dozen image- and life-enhancing CLUTS already available in Filters: G'MIC: Colors: Color Presets. These CLUTs have been collected from a number of websites so you can safely find them yourself in GIMP. The user interface for that plug-in is the same as you already may have patiently learned to use from this gentle introduction.

A nod of appreciation -- no, make that a full head-banging salute -- to G'MIC plug-in author David Tschumperlé.
GIMP Learn rocks...
2

nidhogg
Forum Member

Post#2 by nidhogg » 25 May 2019, 08:50


Nice and clear presentation neurolurker, thanks for taking the time to familiarize us more with CLUTs.
GIMP Learn rocks...
0

Archie
Forum Member

Post#3 by Archie » 25 May 2019, 09:23


I was thinking the same thing. Very well presented, very informative, nice job neurolurker.
GIMP Learn rocks...
0

skinnyhouse
Script Coder

Post#4 by skinnyhouse » 25 May 2019, 14:39


Agree with nidhogg and Archie - very interesting and nice to be able to actually feel like I understand something new.
Thank you.
0

neurolurker
Forum Member

Post#5 by neurolurker » 25 May 2019, 15:22


nidhogg, Archie, skinnyhouse, thank you so much for having a look and offering a kind word.
GIMP Learn rocks...
0

Krikor
Forum Member

Post#6 by Krikor » 27 May 2019, 04:22


neurolurker, I had already forgotten the CLUTs, but this post of yours has revived my memory.
David Pat was the first to introduce me to these devices (later I'll try to find the site and link the article), and then G'MIC made it easier.
Thank you neurolurker, very informative and interesting reading.

P.S: PAT David Article - https://patdavid.net/2013/08/film-emula ... -gimp.html
Last edited by Krikor on 27 May 2019, 05:34, edited 1 time in total.
"I feel that in both art and music, it's not the success that matters but the pleasure it gives you. Focus on the pleasure and the learning will come naturally." - Brian Weston
0

Krikor
Forum Member

Post#7 by Krikor » 27 May 2019, 05:07


One question I have about CLUTs is their reproducibility via David Tschumperlé's
G'MIC filter - Clut from After - Before Layers
.

In theory it would be possible to create the CLUTs responsible for the difference between two images A and B (the original and the altered).

That is, given an image A, which was altered via the Color Curves tool, thus generating the image B, this filter would be able to generate a CLUT H that if applied in the image A would produce the image B again.

However, although CLUT H is able to produce a result that is actually very close to expected, it was not able to obtain 100% of the expected result (Image B).

The procedure I used was:

Using the
G'MIC - Apply External CLUT
filter, I applied the existing Clut kodak_elite_100_xpro to the original Lenna image (Image A), thus obtaining the Resulting Image B.
Krikor Image A - CLUST kodak_elite_100_xpro
Krikor Image A - CLUST kodak_elite_100_xpro
ImgAClustA.png (229.19 KiB) Viewed 5013 times
Then, with Image B on the layer above Image A (Original) and applying the G'MIC - Clut from After - Before Layers filter, I created CLUST H.

What struck me was that CLUST H was distinctly different from CLUST kodak_elite_100_xpro, which in my view, should not. If they would produce the same result when applied over image A, they should then be identical.

The difference is small, but that's just the point here.
Krikor Image B - CLUST H
Krikor Image B - CLUST H
ImgResultClustB.png (231.96 KiB) Viewed 5013 times
Comparing Image B generated by CLUST kodak_elite_100_xpro and Image C (B) generated by CLUST H, using Color Eraser layer mode.
Krikor - Difference Image B vs C
Krikor - Difference Image B vs C
ImgDif.png (357.27 KiB) Viewed 5013 times
"I feel that in both art and music, it's not the success that matters but the pleasure it gives you. Focus on the pleasure and the learning will come naturally." - Brian Weston
0

neurolurker
Forum Member

Post#8 by neurolurker » 27 May 2019, 19:30


Krikor, thanks for your interest and your notes. Previously I had only briefly visited the CLUT After-Before Layers plugin but went back for another look.

Please allow that I mean well though am no expert and can easily misunderstand the simplest things, but it may be that what you're working toward is a situation where a good theory doesn't hold for a specific plugin's workings.

The After-Before plugin creates a CLUT that represents the differences between the colors present in two separate layers. (Call the layers BASE and PREFERRED.) One would then use the Apply External CLUT plugin to apply the created CLUT to a similar, but not the same, image as the BASE.

However, applying the CLUT back onto the PREFERRED image cannot exactly reproduce the BASE image because the CLUT includes combined color information from both the BASE and PREFERRED images.


Start with a BASE layer:

BASE [122956 CLRs].png
BASE [122956 CLRs].png (404.36 KiB) Viewed 4999 times

Duplicate the BASE layer and invert the colors to make the PREFERRED layer. (This uses a blunt full color-inversion to provide an exaggerated example for the demonstration.)

PREFERRED [122956 CLRs].png
PREFERRED [122956 CLRs].png (403.8 KiB) Viewed 4999 times

With the PREFERRED layer active, goto the After-Before Layers plugin. Change the Input/Output settings to Input layers = Active & below; Output mode = New image; Preview mode = 1st output (default).

When the CLUT appears click OK. [Quirk: The new image shows a transparent icon in the top GIMP icon strip. The CLUT will export properly as it stands, but to fix the visual for GIMP display, add an ALPHA channel to the CLUT.]

Export the CLUT as a PNG named DIFFERENCE:

DIFFERENCE.png
DIFFERENCE.png (265.69 KiB) Viewed 4999 times

Back in the main BASE & PREFERRED layers workspace, with PREFERRED layer active, goto the Apply External CLUT plugin. Set the output to New layer. Browse to and apply the DIFFERENCE CLUT.

One would reasonably expect it to simply reverse the PREFERRED layer back to the BASE LAYER, but that's not quite what happens:

RESULT [97366 CLRs].png
RESULT [97366 CLRs].png (399.65 KiB) Viewed 4999 times

As the RESULT shows, especially in the Spectrum part of the test image, thousands of the BASE colors are now changed. The difference is much less noticeable in the young woman's face and the landscape but it's definitely present.

I'm absolutely guessing here (and making up the following example), but I think the After-Before plugin's initial purpose may have been to facilitate a kind of batch processing function for re-coloring similar images.

Say you have a series of photos from a same-model same-setting portrait session. Overall the colors of each image would be similar. Working on one of the images from the series, you discover you've made some color changes that you prefer to the original. You want to apply the colors of the preferred version to the other photos in the series. This may be a situation where you create an After-Before CLUT from the two images and apply the resulting CLUT to the other images in the series instead of repeating on each image all the transforming steps it took to get from the BASE to that first PREFERRED image.

Not making this up: CLUTs only contain color information. If you made other kinds of changes to get the PREFERRED, image -- such as sharpening, blurring, vignetting -- a script would be useful to reliably batch-reproduce all those effects.
GIMP Learn rocks...
0

Krikor
Forum Member

Post#9 by Krikor » 31 May 2019, 22:12


hi neurolurker,
I will have to devote a more careful reading of this post. I could not understand it well, I did a quick reading and didn't reproduce the steps reported in this article (which turned out to be a mistake on my part). Due to the language barrier, I will wait until I have a moment where I can calmly read this content.
But I'll do it right. Maybe in the afternoon of this Sunday or the afternoon of next Monday, I should have some time left.

Thanks for trying to clarify me about the functionality of these devices (CLUTs).

By the way, Tim and Eusamuko have created a script that has similar functionality, using curves - Get Curves Plugin. When I say similar, I'm not being literal, but I just stick to the ability to reproduce the same set of changes made to an image via Color Curves.

Thx.
"I feel that in both art and music, it's not the success that matters but the pleasure it gives you. Focus on the pleasure and the learning will come naturally." - Brian Weston
0


GIMP/GL:  🡆 Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 11 guests