Hey
I need to apply a 3D LUT to a layer in GIMP, how do I do that?
Can it be done via ICC or HaldCLUT?
Hey
I need to apply a 3D LUT to a layer in GIMP, how do I do that?
Can it be done via ICC or HaldCLUT?
Possibly using GāMIC? Could you export the layer and apply the HaldCLUT directly using something like imagemagick? (Is the CLUT already in a HaldCLUT form?)
Yes, that is something that could be done in GāMIC, with the filter Film emulation / User-defined.
See screenshot below:
Here, Iāve chosen a HaldCLUT as a .png file, get from : http://gmic.eu/film_emulation/negative_old/clut/fuji_superia_100_+.png
but this should work with other CLUT files.
PS: Iāve also updated the filter today, to make it handle 16bits/channels CLUT files, so donāt forget to press the update button before using it
Does the CLUT have to be in a HaldCLUT form?
The 3D LUT can be in whatever format Photoshop can export it in. Thing is I donāt have Photoshop so I donāt know what formats those might be. If one of you, or someone reading this, does have access to PS, could you check? Then weād know what our options are for using PS 3D LUTs in GIMP, GāMIC or other libre software.
@Morgan_Hardwood I have PS CS6 (Win 7, 64-bit). What would you like me to check?
@Claes there is an option to apply a 3D LUT, could you check two things?
I can use 3D LUTs in my PS CS6 version, and it looks like
However, I cannot export 3D LUTs, exporting was introduced in the PS CC 2014 release. You will find more information here: Export color lookup tables from Photoshop
OK?
Thanks @Claes!
Iām not familiar with those formats - if someone has sample files, please upload!
Ideally, GIMP should support applying a 3D LUT to a layer in whatever format is popular.
For now, we need to find and document the easiest way of being able to use a 3D LUT from PS (or from the world at large) in GIMP. That could mean converting one of those formats you listed into something GIMP/GāMIC can use (what can they use other than HaldCLUT? @David_Tschumperle?), or it could mean creating a HaldCLUT which has the same effect as those PS-compatible 3D LUTs have.
The only difficulty I found when dealing with HaldCLUTs is the gamma curve - itās not always clear what to use.
Here Film Simulation - RawPedia I documented how to create a HaldCLUT using ImageMagick and then how to hack-create a DNG file for use as a HaldCLUT.
Step by step, we would need to:
-colorspace sRGB
, and the other using-colorspace RGB
, as described in the RawPedia link, because we donāt know which one will work correctly.You can get a free Photoshop trial version from Adobe:
@Morgan_Hardwood
Two clues found:
3dl file specification
Cube lut specification
I started writing some LUT code for darktable a while ago and used these LUTs for testing: http://luts.iwltbap.com/#freeware. Those are CUBE files which are really easy to parse and process, the specs are here: http://wwwimages.adobe.com/content/dam/Adobe/en/products/speedgrade/cc/pdfs/cube-lut-specification-1.0.pdf.
If there is need for a simple tool that takes such a CUBE file and applies it to an image (or maybe even just creates a HaldCLUT) then ping me, I could probably turn my local test code into something useful.
The Cube format seems to be a simple text file, should be easy to parse indeed. Iāll try maybe to add a GāMIC command to convert them into HaldCLUT.
By the way, when I see the size of a single CLUT file of 5Mb (zipped), ouch that hurts !
Good to know that we donāt use this format in GāMIC to store the 300+ HaldCLUT we have
I have recently being pointed to the OpenColorIO project, which is licensed under BSD and has support for a large number of LUT formats.
Iām still trying to understand all the functionalities offered by this library, and in particular how to insert it into ICC-based color-managed workflows, but it might be a good option to avoid coding the support for several LUT formats from scratch.
I found this but forgot to paste the link in the previous post:
http://opensource.mikrosimage.eu/ColorPipe-tools/LUTLab/LUT_to_LUT/
I wouldnāt spend too much time on that. OpenColorIO is the movie industryās competitor to an ICC workflow. In theory it might be possible to make the two work together, but in the real world itās an either-or choice.
Being able to directly convert a format like Cube into HaldCLUT would be awesome!
Well, Iāve done a small test with one file found from the link @houz provided, and Iāve been able to import the CLUT data into GāMIC. That was a āmanualā attempt, so with head -n
and tail -n
to manipulate the .cube (text) file, but this worked. Iām pretty sure I can add at least a command that will be able to import some .cube files.
Ok, so here is a first attempt. Refresh your filters in the GāMIC plug-in for GIMP, and try to provide a .cube
file to the Film Emulation / User-defined filter, like this :
And do not expect it to work
This is something Iāve hacked in 20 minutes, so the chances it works for all .cube
files is very low.
Of course, if it doesnāt work as expected, please tell me, eventually send me the corresponding .cube
file for inspection.
Salut! Tested with The Gimp 2.9.3 and gāmic 1.7.2.
Updated User-Defined Film emulation (got Latest update 06/11/2016). Tested a cube from PS6. Result:
Preview warning: Specified Hald-CLUT filename not found.