Howto use the new CLUT module


#1

Made a video with an howto use the new darktable CLUT module without needing to take pictures of an IT8 target, this is the first time I made such a video so might not be that great but hope some will find it useful

(also recored the sound way to soft so now it sounds horrible, sorry for that)


#2

Very nice. Did you try with more patches? The dE you get is quite high, so accuracy might be less than ideal. As a rule of thumb, everything above a dE of 2 is visible. See also https://en.wikipedia.org/wiki/Color_difference

About the manual editing of the .csv, I guess it’s about time to get that fixed … And maybe even make it possible to have a HaldCLUT2dtstyle script that does the magic without any user interaction.


#3

Did try it with more patches (although not this example) and that does decrease the dE significantly although calculation time does go up.


#4

A quick remark: If you use a build of darktable-chart that has commit e876ef3ba77aec87ee2bc716bb86b21b2137f957 (i.e., anything older than this post) then you no longer need to edit the CSV file manually. Instead you can just click on the “export” button in the gui tool.


#5

Will update the description, thanks!


(PkmX) #6

Thanks for the tutorial @dutch_wolf!

So I made a script (and some patches to darktable-chart) to automatically convert HaldCLUTs to dtstyles using the technique in the video. Repo here.

  • You need to build the patched darktable-chart because unfortunately darktable-chart isn’t very programmable at the moment, so I had to patch it so that it can accept all processing parameters from the command line.
  • The script is in tools/haldclut2dtstyle/haldclut2dtstyle.sh. Basically, you give it a valid HaldCLUT in PNG and it will output an .dtstyle with the same name: ./haldclut2dtstyle.sh example-haldclut.png produces example-haldclut.dtstyle.
  • You can optionally specify the number of boxes in the chart (--chartsize), which can be either 4 or 5 (meaning 4^6 or 5^6 boxes respectively). 4 (default) is the same as @dutch_wolf’s video, but it gives rather large dE (usually 2~4) on @patdavid’s film emulation pack.
    • You can try to use 5 if accuracy is important to you, but it is really slow (>10 minutes on an i7-2600, you’ve been warned) as it needs to match ((5^3)^2+32 = 15657) patches. The good news is that it only uses a single core, so it should be trivial to parallelize on a per-file basis.
  • You can also optionally specify the number of final patches in the output (--num_patches), defaults to 49.

I’m converting @patdavid’s film emulation pack in the background at the moment, which will take a while. I will let you know when it is done. :slight_smile:


(Mica) #7

This sounds pretty awesome! I’m excited to try it out.


(PkmX) #8

So, here are the converted dtstyles: https://drive.google.com/open?id=0B7S3WtYAN5gjdFhRMWc2c0xoVk0

Here is a quick snapshot comparison with my haldclut module (left) and the color checker lut output (right), using Kodak Portra 160 emulation:

With the original haldclut:

With converted color checker lut:

The converted color checker lut seems to have a yellowish tint while also having a bit less contrast (dE=2.47971), so I guess there is still some room for improvement.

Let me know if you find this useful. :slight_smile:


[PlayRaw] Dornbusch Lighthouse -- A Film Emulation Challenge
dt styles for arangast's "New Fujifilm XTrans film simulations"
#9

Oh, I started work on something similar already. I’ll let you know how well my approach will work when done.


#10

Nice results looks pretty close, note that the difference might also be explained due to the fact that the modules are not in the same place in the pipeline. I mention this since the dE is only ~2.5 if that is max dE it should be very hard to tell any difference in real life pictures I think (a dE of 2 is a Just Noticeable Difference aka JND)

Anyway if this continue like this my tutorial/howto will soon be outdated (in a good way since it all becomes much easier)


(Jean-Paul) #11

@dutch_wolf I am interested in using the HaldCLUT with darktable that I used with RawTherapee. I followed your video (thanks for sharing), I saw your script auto, but I can not compile it, I’m looking for the file hald_clut_4_with_gradient.pgm and .cht?
Or, can I find them?
Thank you very much.


#12

Hi I didn’t make the script that is something @pkmx did for the cht and pgm files (although not sure if you need that particular one) those can be found here https://www.dropbox.com/s/ezlgx9g39bd4gme/dt_chart_experiment_results.tar.gz?dl=0


(Jean-Paul) #13

Thanks for the files, it will advance my work.
Best regards.


(Jean-Paul) #14

Thanks again for the link to the files. I am able to work with testig_new exported in .pfm, I can load the .cht into dartable-chart.
I tried with a movie file and when I want to apply the file hald_clut_4_with_gradient.cht, I have: error parsing CHT file, (parse_cht: 364)


#15

Not sure what you are trying to do there but the cht files is only for use with darktable-chart. If loading the file in darktable-chart gives errors I need to investigate what goes wrong.

EDIT: Okay indeed something goes wrong in both the release and git version of darktable-chart, although seems to be different things (release just gives the error, git version takes ages to load the cht file)

EDIT2: after some debugging and testing I have a new cht file that should work (remove the .txt extension .cht files are text files but only allowed to upload here with txt extension)hald_clut_4_with_gradient_v2.cht.txt (152 Bytes)


(Jean-Paul) #16

Thanks for the reply and the file. I try it and I tell you.


(Jean-Paul) #17

The debug script works perfectly. On the other hand, when I convert the .csv file to .dtstyle with darktable-chart and load it into the “style” tab of dartable, it does not load. It seems that there is a problem with with version 2.2.5?
Still thank you for the work done to run the script.
Best regards.


#18

Can you upload the style somewhere?


(Jean-Paul) #20

I followed the tutorial of @dutch_wolf and added the 2 lines HDR00 and HDR01 to the .cvs file:
https://drive.google.com/file/d/0B1cvWUEQ2QwiUlBDLTVFMVhIZlE/view?usp=sharing
And then I used the darktable-chart command to get the .dtstyle file:
https://drive.google.com/file/d/0B1cvWUEQ2QwiT3g1dkE3ZUh3cWs/view?usp=sharing


(Jean-Paul) #21

I just re-tested. The profile DTStyle is well download in “style” of darktable but with a single black patch.