A LUT looks great on the seller's sample and terrible on your own clip: the skin turns orange, the sky goes cyan, the shadows are either grey mud or solid black. Most of the time the LUT is not the problem. It was put in the wrong place in the chain, on footage it was never made for, or at a strength meant for a different shot. This guide explains what a 3D LUT actually is, where it belongs in a grade, why it fails on log footage, how to make it lighter, and how to read and apply a .cube file in a few lines of Python or with one FFmpeg command. Both were run as printed, the Python on Python 3.12 with numpy.
#What a 3D LUT is
A 3D LUT is a table that answers one question for every colour: "this red, green and blue go in, which red, green and blue come out?" A .cube file stores the answers on a grid. A size of 33 means 33 steps per channel and 33 × 33 × 33 = 35,937 rows of three numbers. Colours between the grid points are interpolated from the nearest ones: trilinear interpolation blends the eight corners of the little cube a colour falls in, tetrahedral interpolation uses four of them and is a little smoother on gradients.
That has two consequences people tend to forget. First, the LUT knows nothing about your camera, your exposure or your white balance; it only maps numbers to numbers. Second, it is fixed: whatever went into it as "a normal mid grey" is what it expects to see as mid grey. A creative look made for Rec.709 or sRGB display values expects a clip that already looks normal on screen.
#Where it goes in the chain
Put the look after the corrections, not before them. The usual order is:
- Conversion. If the footage is log or raw, convert it to Rec.709 first, with your editor's colour management or the camera maker's technical LUT. A creative look is not a conversion.
- Correction. Set exposure and white balance so that a grey card is grey and faces look like faces. Match shots to each other here.
- The look. Apply the creative LUT last, on a separate node or adjustment layer, so you can change its strength or swap it.
- Finishing. Small touches after the look, such as a vignette or a final contrast tweak.
A LUT applied before the white balance bakes the colour cast in: correcting a warm shot after a warm look pulls against the look itself, and the result is muddy. The same applies to photos: develop the raw file first, then load the LUT as an adjustment layer on top.
#Why it looks wrong on log footage
Log footage is deliberately flat. Mid grey sits higher and the blacks are lifted, so the camera can record more stops of light. A creative look made for Rec.709 reads those flat values as a pale, washed-out image and pushes them accordingly: the contrast it adds lands in the wrong places and the saturation it adds lands on colours that are not saturated yet. The fix is not a stronger look but a conversion first. If a LUT seller does not say which input the look expects, assume Rec.709 and test it on a converted clip, never directly on log.
#Making a look lighter
A look at full strength is a starting point. Lowering it means mixing the graded result with the ungraded one: at 50 % every value lands halfway between the two. In DaVinci Resolve that is the key output gain of the node, in Premiere Pro the Intensity slider of Lumetri's Look, in Photoshop the opacity of the Color Lookup layer. A half-strength .cube file does the same thing in one file, which helps in programs that cannot mix, such as some live video tools.
#Reading and applying a .cube file in code
The format is plain text: an optional title, LUT_3D_SIZE, an optional input range in DOMAIN_MIN and DOMAIN_MAX, then one row of red, green and blue per grid point, with red changing fastest and blue slowest. This reader and a trilinear lookup fit on one screen:
import numpy as np
def read_cube(path):
"""A 3D .cube file: LUT_3D_SIZE n, then n*n*n rows of R G B, red changing fastest."""
size, lo, hi, rows = 0, np.zeros(3), np.ones(3), []
for line in open(path, encoding="utf-8"):
parts = line.split()
if not parts or parts[0].startswith("#") or parts[0] == "TITLE":
continue
if parts[0] == "LUT_3D_SIZE":
size = int(parts[1])
elif parts[0] == "DOMAIN_MIN":
lo = np.array(parts[1:4], float)
elif parts[0] == "DOMAIN_MAX":
hi = np.array(parts[1:4], float)
elif parts[0][0] in "0123456789.-":
rows.append([float(v) for v in parts[:3]])
table = np.array(rows).reshape(size, size, size, 3) # indexed [blue][green][red]
return table, lo, hi
def apply_cube(rgb, table, lo, hi, strength=1.0):
"""Trilinear lookup for an (..., 3) array of display values; strength mixes with the input."""
n = table.shape[0]
x = np.clip((rgb - lo) / (hi - lo), 0, 1) * (n - 1)
i = np.minimum(np.floor(x).astype(int), n - 2)
f = x - i
out = np.zeros_like(rgb, dtype=float)
for db in (0, 1):
for dg in (0, 1):
for dr in (0, 1):
w = ((f[..., 0] if dr else 1 - f[..., 0]) * (f[..., 1] if dg else 1 - f[..., 1])
* (f[..., 2] if db else 1 - f[..., 2]))
out += w[..., None] * table[i[..., 2] + db, i[..., 1] + dg, i[..., 0] + dr]
return (1 - strength) * rgb + strength * out
if __name__ == "__main__":
import sys
table, lo, hi = read_cube(sys.argv[1])
pixels = np.array([[0.5, 0.5, 0.5], [0.85, 0.62, 0.48], [0.2, 0.35, 0.6]])
for strength in (1.0, 0.5):
print(strength, np.round(apply_cube(pixels, table, lo, hi, strength), 3).tolist())
Two checks are worth running on any LUT before you trust it. An identity table, where every grid point maps to itself, has to return its input; ours did, with an error of 2e-16. And mid grey should stay close to grey: on a teal and amber look the sample turned 0.5, 0.5, 0.5 into 0.505, 0.512, 0.502, warmed a skin tone of 0.85, 0.62, 0.48 to 0.913, 0.663, 0.45 and pushed a blue towards teal. At strength 0.5 every value landed halfway, and matched the half-strength file of the same look to three decimals. A look that turns mid grey visibly green or magenta will tint every neutral in your shot.
For video, FFmpeg applies a .cube directly, with tetrahedral interpolation if you ask for it:
ffmpeg -i in.mp4 -vf "lut3d=file=look.cube:interp=tetrahedral" -c:a copy graded.mp4
Its haldclut filter takes the other common format, a HaldCLUT: the same table stored as an image, which photo tools such as GIMP's G'MIC, darktable and RawTherapee read.
#What makes a good look
- Grey ramps stay in order. A darker grey in must give a darker value out, or gradients band and skies break into steps.
- No hard clipping. Saturated colours should be pulled back towards their own brightness before they hit the limit, so a red sign stays red instead of turning into a flat primary.
- Usable black and white points. A faded look lifts the blacks on purpose, but a look that crushes everything below 10 % throws away detail you cannot get back later.
- Black and white looks are truly neutral. R, G and B must come out equal, or a "mono" look leaves a faint tint that shows in print.
#A set of looks built that way
We made Filmwren, 24 looks for photo and video, from clean contrast and film-print styles to teal and amber, night city, golden hour, winter blue and three black and white looks. Each comes as a 33-point .cube, as a half-strength .cube and as a HaldCLUT PNG. The looks are built from simple monotone steps (a tone curve, slope, offset and power, white balance, saturation, split toning, fade and a soft gamut clip), and the tests check that every look keeps values in range, keeps grey ramps in order, has no jumps between neighbouring grid points, and that the monochrome looks are exactly grey. They are made for Rec.709 and sRGB display values, so convert log footage first. The files were applied in code to three rendered scenes; they were not opened in Resolve, Premiere, Final Cut Pro, Photoshop or OBS. It is listed as Coming soon.
#Frequently asked questions
Why does my LUT make the footage look orange or too contrasty?
Usually because it was applied before exposure and white balance were set, or on log footage that was not converted first. Correct the shot, convert log to Rec.709, then apply the look.
Can I use a creative LUT on log footage?
Not directly. Convert the footage to Rec.709 with colour management or a technical LUT for your camera, then apply the creative look after it.
Is 33 points enough, or do I need 65?
For smooth creative looks 33 points is the common size and plenty. Larger tables matter for looks with sharp changes, which a good creative look avoids anyway.
How do I make a LUT weaker?
Mix it with the original: lower the node's key gain, the layer's opacity or the look's intensity, or use a half-strength version of the file.
Comments
Comments
No comments yet. Ask a question or share what worked for you.
Leave a comment