How to uncompress gmic_film_cluts.gmz ?

(Gerpy Tokumeino) #1

Hi, with Jean-Paul Gauche (I met him on the forum), we are trying to convert various film emulations into darktabkle styles. We kniow it won’t be 100% accurate but we try our best to improve the process.

We can convert styles expressed as HaldCLUTs PNGs a s those used in Rawtherapee. We’d like to convert G’MIC film emulations and styles, but all we can find is the gmic_film_cluts.gmz file ( How can I uncompress gmic_film_cluts.gmz ? Will it produce PNG files ?

Best, Pierre.

(David Tschumperlé) #2

CLUTs in G’MIC are represented in a compressed way (sparse colored point cloud in the RGB cube), so each CLUT need to be decompressed before saving it to a .png file.
The following G’MIC command does the job:

cluts2png :
  v - i
  N=$! repeat $N l[$<] n={n}
    v + e[] "  > Decompress CLUT '"$n"' ["{1+$>}/$N"]" v -
    decompress_clut 64
    r 512,512,1,3,-1 w -1,-1,0,$n
    o $n.png
  endl done v +

It outputs 359 .png files (resolution 512x512), corresponding to all the CLUTs available in G’MIC.
Here is the link to the zip file containing all these PNGs :

(Gerpy Tokumeino) #3

Thank you so much !!! Just one question : what does the “64” denote in “decompress_clut 64” ?

(David Tschumperlé) #4

That is the resolution of the CLUT along the R,G and B axes.
64 is a good choice because 64^3 = 512^2, which means the resulting 3D CLUT can be easily converted to a 512x512 2D png image.
Choosing 16 is also possible (as 16^3 = 64^2), but it is maybe a quite low resolution for storing all the variations happening in some CLUTs.
Other choices of resolutions would lead to incompatible sizes when converting to a 2d image.

(Jean-Paul) #5

Hello, thanks for all this information that will be useful in making dtStyle for darktable. For now, I was doing it using the proposed method:
There was a post: Howto use the new CLUT module
but the dtStyle I was doing wasn’t very satisfying.
Best regards.

(Mica) #6

RawTherapee also uses a bunch of the same film simulations (though I think G’MIC has more). You can download those files from RawPedia.


I really should redo that video with a modern version of darktable since I made it when the LUT module in darktable was still in development (which is now years ago).

(Jean-Paul) #8

Indeed, we have used the proposed HaldCLUT. I have been following Pat Davis’ works for a long time and I tried them with darktable, a Git branch allowed to use them. Conversions to dtStyle give quite variable results. We are looking for a method that gives comparable RAW treatments in darktable and RawTherapee before applying styles.

(Jean-Paul) #9

Yes @dutch_wolf, you made an.cht file which allowed me to follow your tuto and to be able to make an.pdf in French. The method @temperdu has developed is different. We talk about it on:
This forum is in English but you should be able to follow with the online translation as I do to follow you here. Best regards.