What are 3D cluts useful for?

Hey guys. I’m calibrating my screen and noticed DisplayCal (dispcalgui) can convert regular profiles into 3d cluts. What are the 3d ones useful for? Couldn’t find much useful info online so I thought I’d ask the knowledgeable folks here :wink:

They’re used the way any Look Up Table might be used. If you’re working in RGB colors, then it makes sense that a color lookup using those three values would be three-dimensional in nature. I think this is possibly how the corrections are stored internally? (I will defer to some of the way more knowledgeable folks than me around here…)

Though not related to screen profiles this maybe worth reading (or asking Anders Torger)

1 Like

The ImageMagick docs have usage and discussion notes on CLUTs from a processing standpoint:
http://www.imagemagick.org/Usage/color_mods/#color_lut

In general, 2D/2.5D ones are easier to manipulate; therefore, simpler to use.

thanks for that link @afre ; if not directly related to monitor’s calibration was helpful to me personally as I got to know IM’s commands for generating and manipulating hald LUTs; gonna put this to practice translating 3Ds for gmic. :cheese: Cheers =)

The lut “profiles” produced by DisplayCal are used with Blender and Krita when using opencolorio to manage colors - ICC profile color management isn’t the only way to manage colors.

The path to the luts goes into “config.ocio” and serves the same purpose as an ICC monitor profile in an ICC profile color-managed workflow.

I finally managed to get a couple of proper ocio luts and a proper config.ocio to use with blender and krita, but it wasn’t easy, and the example given in the above-linked stackexchange article doesn’t cover all the necessary information. But it’s a starting point.

https://www.ludd.ltu.se/~torger/dcamprof.html#2.5d_vs_3d

Hi @Morgan_Hardwood - did I give a totally wrong answer? Or rather answer totally the wrong question? :slight_smile: In which case my apologies!That link you provide doesn’t seem to be at all related to making profile luts for use in ocio color management.

I have a question, what are the file formats for 3D CLUTs? Is there one standard? What do the various programs accept?

I get questions now and then about them on the /r/photography question thread and I have no idea how to answer.

Based on what I have read, apps generally don’t use 3DCLUT files. Instead, they save and read a flattened version (hald-clut) that isn’t restricted to a file format. However, proprietary formats like Adobe’s *.cube exist. G’MIC can read and write *.cube files.

PS More LUT formats: http://opencolorio.org/FAQ.html#faq-supportedlut

This is awesome, guys, thank you so much!

Hey @Elle
Knowing what 3D LUTs are useful for requires knowing what they are. I think we both addressed different aspects of that question, by no means exhaustively. I thought the DisplayCal documentation also had something about that, but I couldn’t find it after a brief ctrl+f skim.

Well, here’s my simplistic (and wordy :slight_smile: ) attempt at “what” and “why”:

What:

@patdavid already summarized what a lookup table is. A lookup table (in any field, not just image editing) says for every number “x” in the source file, look “x” up in the table and replace it by some other number “y”.

For example, before computers allowed to calculate logarithms of numbers “on the fly”, people used logarithm tables.

Even in the age of computers, sometimes it’s faster for a program to create and use a lookup table instead of actually doing the calculations “on the fly”. For example GIMP (actually babl) code uses lookup tables for converting from floating point to 8-bit integer.

Why:

In image editing, as far as I know there are two main reasons for using various types of LUTs for editing images:

  1. Sending image values to a screen for display in an OCIO-color-managed editing application (3D lookup table - Wikipedia): This requires a look-up table that is made using an input color space, which is the color space the image is stored in; and an output color space, which is the color space of the device on which the image is displayed.

    • This is the type of lut that DisplayCal can be used to make. The resulting LUT is used with OCIO-capable software. This LUT isn’t used to modify the “look” of the image, but rather to create a faithful reproduction of the image on the specified output device.
    • Obviously you can’t take a LUT made for input space A and output space B, and use it for some other combination of input/output spaces.
  2. Modifying the look of an image: This is a completely different use case:

    • Let’s say you want to take a scene-referred interpolation of a raw file from a camera with a sensor that has a basically linear response to light.
    • Let’s say you want to make this “flat” image look like it was produced by making a print from slide film. Slide film has a toe and a shoulder in its response to light, and also responds differentially to different wave lengths of light.
    • There are various types of slide films with differing response characteristics, and then there are variations in the print process.
    • A “slide film” lookup table takes the input image RGB numbers and replaces them with a different set of RGB numbers. So a 3D table is required. A “slide film” lut will compress shadows and highlights, and will variously increase/decrease the proportion of red, blue and green as the input RGB values go from dark to light.

Just as with OCIO color management LUTs, a slide film “look-modifying” LUT presumes a given input RGB color space. So if you use the LUT with some other input RGB color space, the result will not be what the person who made the LUT anticipated.

Also if you are thinking about a particular look from a particular type of slide film printed using a particular process with particular chemicals, well, unless the slide film lut was based on that exact combination that you have in mind, it won’t be exactly what you want. But maybe it will be a starting point for further processing.

1D and 3D “look luts”:

A 1D lut can be used to modify the tonality of an image. This is a “lut” equivalent of using Levels or Curves to modify the “Value channel” - terminology used in GIMP - “Value channel” in this case just means “modify all three channels by exactly the same amount”. A 3D lut allows to modify each channel individually, thus changing color as well as tonality. I’m sure there are other types of “1D/3D” luts, but these are the only two types I know of.

Maybe I am just seeing things :blush: but I thought 3D LUTs were in 3D space, so 3 channels would still be considered a stack of 1D, whereas 3D would have interactions in all directions…

Hmm, what you say sounds very plausible. Do you have specifics or a link that explains the difference between a stack of 1D and a 3D? What are the use cases for a 3D vs a 1D? I’ve used both display and “look” luts in blender, but mostly just the display luts.

The 3D LUTs can be represented as a stack of 2D luts, which is exactly what the HaldCLUT is doing (slices of the cube along a particular axis).

@patdavid Yes, that is why I mentioned the hald-clut above. I made a typo: I meant to write 2D. PS Actually, I don’t know whether it is supposed to be 1D or 2D; my Ds aren’t in a row :confused:.

@Elle I am really not the person to ask :rofl:. I just like to read and help others. Let me know what you discover :slight_smile:.

Maybe to clarify the Ds a bit:

1D lut maps a 1D value to another 1D value, for example 4 to 5 or more general x to a
2D lut maps a 2D value to another 2D value, so (x,y) to (a,b)
3D lut maps a 3D value to another 3D value so (x,y,z) to (a,b,c)
etc.

In mathematics and nD value is also called a vector in nD space so even more general a nD lut maps a vector in that space to another vector in that space (aside: a 1D vector is more often known as a scalar). Theoretically speaking it is also possible to have a nD to mD lut (so for example 3D to 2D which maps (x,y,z) to (a,b))

How this can be represented varies but for 3D this can be represented as a cube or slices of such a cube beside less common visualizations, for a 2D a plane is the simplest view and for a 1D lut a line on a graph probably suffices.

@dutch_wolf Just half-asleep, and being decades removed from math doesn’t help either. To jog my memory I usually watch one of two movies:

Fun times :joy:. I haven’t read Abbott’s books yet.