CLUT files and CLI GMI'C.

Hello,

I am trying to make use of the local CLUT file packs available for GMI’C. The thing is I am not using any GIMP nor QT-GMI’C just pure CLI.

I am clueless if this is possible, based on the manual it is but the binary needs internet access, and the way I am compiling GMI’C is by not including the network part of it since I work with it locally most of the time (the x_ utilites like paint, crop, etc. Wonderful, thank you David!).

I want to reference a GMZ file with all the CLUTS in it or just the single CLUT in ‘cube’ format and be done with it, but no easy way for me. I did check the manual but no luck.

I’m on GMI’C 2.9.9, I’ll be compiling the latest release very soon but I wonder if using local CLUT files is a thing while working in CLI mode with GMI’C.

Thank you!

Use the About/Download External Data filter in gmic-qt to download and populate $HOME/.cache/gmic (Linux, MacOS) or %APPDATA%/gmic (Windows) with the CLUT files; both gmic-qt and gmic share this cache, and any CLUT in that directory is visible in both. The directions for that filter also furnish a method to download the CLUTs without using gmic/gmic-qt. After downloading, then:

$ gmic -h clut

lists all available CLUTs in that cache. To use one, write some pipeline like:

$ gmic sp cat,512 +map_clut. faux_infrared_bw_1

At your leisure, do gmic -h on these CLUT-related CLI commands:

clut2hald
clut
compress_clut
dclut
decompress_clut
decompress_clut_pde
decompress_clut_rbf
display_clut
gcd_extract_clut
hald2clut
map_clut
random_clut
random_clut
strclut

Hope this helps.

1 Like

Hello @baco

All G’MIC CLUTs are stored in this file : http://gmic.eu/gmic_cluts.gmz
This file is downloaded once when you request a new clut with command clut, e.g.

$ gmic clut summer

So, if you have the possibility to do this once, with an internet connection enabled, you’ll get this file, then you’ll be able to work offline with all the G’MIC CLUTs.
Otherwise, get the gmic_cluts.gmz file and copy it on your machine, in the right folder, that is:

  • $HOME/.cache/gmic on Linux.
  • %APPDATA%/gmic on Windows.

and that should work too.

1 Like

Thank you for your responses.

I tried it but I think now I just need to compile the new release, I am getting an error.

tc@box:~/Descargas$ gmic3 remastered.jpg clut fezzle,17
[gmic]-0./ Start G'MIC interpreter.
[gmic]-0./ Input file 'remastered.jpg' at position 0Invalid SOS parameters for sequential JPEG
 (1 image 4608x3456x1x3).
[gmic]-0./+clut/ Input CLUT 'fezzle' with resolution 17.
[gmic] *** Error in ./+clut/*local/*if/ *** Command 'input_cached': Unknown filename 'gmic_cluts.gmz'.

tc@box:~/Descargas$ ls ../.cache/gmic/
gmic_cluts.gmz

Nor

tc@box:~/Descargas$ gmic remastered.jpg +map_clut. fezzle
[gmic]-0./ Start G'MIC interpreter.
[gmic]-0./ Input file 'remastered.jpg' at position 0Invalid SOS parameters for sequential JPEG
 (1 image 4608x3456x1x3).
[gmic]-1./ Map color LUT fezzle on image [0].
[gmic] *** Error in ./map_clut/*if/+clut/*local/*if/*if/ *** Command 'input': File 'https://gmic.eu/gmic_cluts.gmz' is not in .gmz format (magic number not found).

Thank you!

No, you don’t. You are missing the fezzle CLUT and likely need to follow a course of action along what @David_Tschumperle or I suggested above, to wit: when you obtain access to a machine connected to the Internet, download the file that David suggested. You can confirm that your procedure has been a success when you type:

gmic -h clut

and find in the resulting help blurb fezzle:

The dump typically has many hundreds, perhaps even a thousand or more separate entries (1,105 here), should you download by one means or another the complete set of CLUTS that G’MIC has to offer. If your list is shorter — or missing fezzle or whatever other CLUT you’ve read about — then you are missing downloads, or the downloads have obtained have gone in the wrong places.

As an aside, if you are compiling your own gmic, you may need to:

$ gmic update

to ensure you have all the official and community-related custom commands. Especially if gmic -h clut returns an error instead of a CLUT list. Oddly behaving help usually is an indicator to update your (freshly compiled) instance. Of course, this supposes that you are connected to the Internet.

For point of reference:

gmic testimage.png clut fezzle,17 +map_clut.. .

should produce an image list with the original, the CLUT, and the altered outcome:

Hope this helps. Keep us posted (and welcome to the board)!

1 Like

Appreciate your warm welcome and help.

I did not mention it but I downloaded the gmic_clut.gmz file and placed it in the right place /home/user/.config/gmic.

Typing gmic -h clut does gives me output:


     vintage_chrome | vintage_mob | vintage_warmth_1 | violet_taste |
     vireo_37 | warm | warm_dark_contrasty | warm_fade | warm_fade_1 |
     warm_highlight | warm_neutral | warm_sunset_red | warm_teal |
     warm_vintage | warm_yellow | well_see | western | westernlut_2 |
     whiter_whites | winterlighthouse | wipe | wooden_gold_20 | yellow_55b
     | yellow_film_01 | yellowstone | you_can_do_it | zed_32 | zeke_39 |
     zilverfx_bw_solarization | zilverfx_infrared | zilverfx_vintage_bw } :
     Default values: 'resolution=33' and 'cut_and_round=1'.

    Example:
      [#1] clut summer clut alien_green,17 clut orange_dark4,48

I decided to use one of the CLUT’s in the output; zed_32. No luck.

tc@box:~/Descargas$ gmic remastered.jpg +map_clut. zed_32
[gmic]-0./ Start G'MIC interpreter.
[gmic]-0./ Input file 'remastered.jpg' at position 0Invalid SOS parameters for sequential JPEG
 (1 image 4608x3456x1x3).
[gmic]-1./ Map color LUT zed_32 on image [0].
[gmic] *** Error in ./map_clut/*if/+clut/*local/*if/*if/ *** Command 'input': File 'https://gmic.eu/gmic_cluts.gmz' is not in .gmz format (magic number not found).

Just as a test, I tried to open the gmz file, but got the same error: magic number not found. But the .cube file opens without issues.

I haven’t compiled gmic yet.

md5 checksum:
0d75010061c7925a022e7b35db6fe465 ./gmic_cluts.gmz

Hello @baco ,
I think this is due to a change in the .gmz file format that occured between versions 2.9.x and 3.0.x.
So, indeed if you recompile the latest version of G’MIC, you should be able to read the .gmz file and get the CLUTs as expected :slight_smile:

1 Like