Page 1 of 1

Request for LUT file support (.cube, .lut, .3dl..)

Posted: 2018-11-24T23:17:04-07:00
by B4adle7
Upon asking if Imagemagick supported .cube files yet, it was suggested to come here and post to ask for the feature request.

Feature Request: Support for 1D/3D LUT (Look Up Table) files. e.g. .cube, .lut, .3dl. ... on-1.0.pdf

Imagemagick supports CDL data (-cdl <cdl file>). It also supports CLUT as HALD files. (-clut <hald .png>)

Aside from needing to convert a LUT file into a HALD image with the specified LUT, it generally does the trick.

However for a while now, have been running into more and more instances where color conversions seem to be done while wearing boxing gloves.
Getting images that are being pushed into the negatives and/or pushed color values well over 1.0 before then getting the counter-part CDL or LUT that brings the colors back into 0.0-1.0 range.

Granted, I have not attempted using an .exr as a HALD yet, will give it a try. Also ham-fisting color conversions would not be IMDev's problem.
But the use of PNG HALDs now truncate the data, since it cannot record color values below 0.0 or above 1.0. Especially clipping the top before applying the associated color transform really shows up.

Again, this might be cured by using an alternate image format.
However is it possible to request the support of some of the most standard LUT files? I believe .cube is the most prolific format.
It would be wonderful to hear whether this was a worthy consideration for a feature. (or to smack me on the head to tell me already done.)

Re: Request for LUT file support (.cube, .lut, .3dl..)

Posted: 2018-11-25T10:54:03-07:00
by magick
Grab the latest source repo from Git. It supports .cube:

Code: Select all

identify -verbose cube:FG_CineBasic.cube
We still need to support certain keywords and we don't support write just yet.

Re: Request for LUT file support (.cube, .lut, .3dl..)

Posted: 2018-11-25T15:02:10-07:00
by fmw42
So ImageMagick in IM can do the above for a 3D lut. That is it can read the cube file. But the docs at ... on-1.0.pdf, which explain how to read the file, do not seem to explain how one applies the 3D Lut to an image. Does anyone know or have a reference that explains how it is applied and especially one that has code?

Re: Request for LUT file support (.cube, .lut, .3dl..)

Posted: 2018-11-25T18:40:03-07:00
by fmw42
This may be useful to those who code. ... 6#25252446

Also see ... UT_to_LUT/

This seems to imply that G'MIC can convert a .cube lut to a halt lut. That seems like a possible way to go here for ImageMagick.

Past discussion is at ... hp?t=22252