Convert 3D LUT to hald image

Discuss digital image processing techniques and algorithms. We encourage its application to ImageMagick but you can discuss any software solutions here.
graham768
Posts: 1
Joined: 2018-03-09T12:10:51-07:00
Authentication code: 1152

Re: Convert 3D LUT to hald image

Post by graham768 » 2018-03-09T12:23:16-07:00

I've found a solution on another forum. I used the GIMP plugin G'MIC from the command line. It's really simple to install on linux; I used homebrew on mac with

Code: Select all

brew install gmic

The script takes a LUT input (in my case .CUBE) and converts it directly to a Hald Clut PNG

Code: Select all

gmic -input_cube /path/to/lutfile.cube -r 64,64,64,3,3 -r 512,512,1,3,-1 -o haldclut_output.png
I created a quick and dirty script to take a directory of files and quickly give the PNG output.

VbNetMatrix
Posts: 1
Joined: 2018-04-08T07:32:30-07:00
Authentication code: 1152

Re: Convert 3D LUT to hald image

Post by VbNetMatrix » 2018-04-08T07:46:02-07:00

I'm glad you found a solution after so many years!

however, Since LUT are simply a MASK to a picture (apply bit per bit with a corresponding math function),
II believe 2D LUT (PNG) should be supported directly with image magick.

this would avoid us the trouble to load the image in photoshop to apply the LUT on image.
LUT are also used in direct feed camera for streaming (with OBS/Twitch/Youtube)

thanks for Image Magick though, great program.

snibgo
Posts: 10365
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert 3D LUT to hald image

Post by snibgo » 2018-04-08T08:33:48-07:00

ImageMagick supports both "2D" and "3D" luts, using "-clut" and "-hald-clut" respectively. However, IM needs the luts to be images, and doesn't support formats such as .CUBE.
snibgo's IM pages: im.snibgo.com

B4adle7
Posts: 1
Joined: 2018-06-10T10:25:40-07:00
Authentication code: 1152

Re: Convert 3D LUT to hald image

Post by B4adle7 » 2018-06-10T10:42:57-07:00

How can we make a feature request to support .cube and/or other basic 3D Lut data files? (.lut, .shlut, .3dl, .cube)

Currently ImageMagick supports other data files such as CDLs. However it currently only supports HALD files for LUT transforms.
In order to create the HALD files ImageMagick users need to use a separate software package, find a conversion script, or reverse engineer and write a converter.

I recall this subject has been brought up in other posts. I know FFMpeg supports .cube and other 3D Luts, I believe. And it may remove some of the HALD limitations, such as support for negative or over 100% values.

User avatar
fmw42
Posts: 23406
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert 3D LUT to hald image

Post by fmw42 » 2018-06-10T11:36:21-07:00

How can we make a feature request to support .cube and/or other basic 3D Lut data files? (.lut, .shlut, .3dl, .cube)
Post this same message to the Developer's forum.

snibgo
Posts: 10365
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert 3D LUT to hald image

Post by snibgo » 2018-06-10T11:44:24-07:00

B4adle7 wrote:How can we make a feature request to ...
Post to the Developers forum: http://www.imagemagick.org/discourse-se ... 1351dd23dd

To help the developers, you should include references to documentation on the formats you would like supported.

Ideally also suggest how IM will identify the format. If any of those formats are valid image formats, then a suffix (.lut etc) isn't sufficient.
B4adle7 wrote:And it may remove some of the HALD limitations, such as support for negative or over 100% values.
It already does, in the sense that if the hald-clut contains values outside 0 to 100%, those values will be used in output. However the input coordinates to the hald-clut correspond to input values of 0% at top-left to 100% at bottom-right. Do you want this to be more flexible? If so, please describe.
snibgo's IM pages: im.snibgo.com

Post Reply