FrostKiwi's
Secrets

Thermal Camera LUTs and colormaps for DaVinci Resolve #

Created: 2024.03.01

When writing my previous article about LUTs in video games, I noticed that there is no straight forward way to colormap grayscale footage in DaVinci Resolve, a popular video editing and color grading suite for Windows, Linux and MacOS. On the internet you can find LUTs which attempt to color RGB video in the style of thermal camera footage, but I didn’t find standard colormaps.

Cold ice cream and hot tea, Camera: TESTO 890, colormap LUT "inferno"

I exported every colormap that matplotlib supports as a 1D .cube file, so you can colormap footage in DaVinci Resolve. This is especially needed for thermal camera footage, when you want to adjust the color mapping more finely. The input is expected to be grayscale. You can preview them and download the ones you need. Since it’s a .cube file, it should work for other Software with .cube input as well.

Export Python script #

Luckily, Python package colour-science supports exporting to the .cube “Iridas/Adobe” format, which DaVinci Resolve uses for its LUTs. Double luckily, the format supports 1D LUTs, so no extra manipulation is needed.

If you want to perform the export yourself or need a colormap not listed, then you can use the Python script below. Required dependencies can be installed via pip install colour-science matplotlib.

Python export script colormap-as-cube-lut.py
import argparse
import numpy as np
import matplotlib.pyplot as plt
from colour import LUT3x1D
from colour.io import write_LUT_IridasCube


def generate_and_export_lut(colormap_name, lut_size, file_name):
	grayscale_values = np.linspace(0, 1, lut_size)
	colormap = plt.get_cmap(colormap_name)
	colors = colormap(grayscale_values)[:, :3]

	lut = LUT3x1D(table=colors, name=f"Colormap {colormap_name}")
	write_LUT_IridasCube(lut, file_name)

	print(f"LUT file for {colormap_name} saved to {file_name}")


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Output a colormap as 1D .cube LUT")
    parser.add_argument("--colormap", type=str, help="Name of the colormap to use.")
    parser.add_argument(
		"--lutsize", type=int, default=256, help="Size of the LUT. Default is 256"
	)
    parser.add_argument(
		"--list-all", action="store_true", help="Print a list of all available colormaps"
	)
    args = parser.parse_args()

    if args.list_all:
        print("Available colormap names:")
        for name in plt.colormaps():
            print(name)
    elif args.colormap:
        file_name = f"{args.colormap}.cube"
        generate_and_export_lut(args.colormap, args.lutsize, file_name)
    else:
        print(parser.format_help())

Usage #

In the DaVinci Resolve Settings and General, you can add new LUT Folders. Add a Folder. In that folder create a subfolder, where your color maps will be in.

Download the required LUTs and put them into that subfolder. In DaVinci Resolve you can go to the color page, click on the LUTs tab and select our subfolder. If needed, you can right click in the folder pane and Refresh to re-scan the folder for LUTs.

That’s it, now you can apply colormaps to grayscale footage, coloring the footage.

Preview #

Here you can preview all available colormaps, with the following video and the selectbox. Unless you have specific artistic goals or special data layout, you should use should use the perceptually uniform LUTs, because reasons.

LUT collection #

Here you can download the .cube files individually or as one .zip

PreviewDownload
Perceptually Uniform Sequential
viridis
plasma
inferno
magma
cividis
viridis - flipped
plasma - flipped
inferno - flipped
magma - flipped
cividis - flipped
Sequential
Greys
Purples
Blues
Greens
Oranges
Reds
YlOrBr
YlOrRd
OrRd
PuRd
RdPu
BuPu
GnBu
PuBu
YlGnBu
PuBuGn
BuGn
YlGn
Greys - flipped
Purples - flipped
Blues - flipped
Greens - flipped
Oranges - flipped
Reds - flipped
YlOrBr - flipped
YlOrRd - flipped
OrRd - flipped
PuRd - flipped
RdPu - flipped
BuPu - flipped
GnBu - flipped
PuBu - flipped
YlGnBu - flipped
PuBuGn - flipped
BuGn - flipped
YlGn - flipped
Sequential 2
binary
gist_yarg
gist_gray
gray
bone
pink
spring
summer
autumn
winter
cool
Wistia
hot
afmhot
gist_heat
copper
binary - flipped
gist_yarg - flipped
gist_gray - flipped
gray - flipped
bone - flipped
pink - flipped
spring - flipped
summer - flipped
autumn - flipped
winter - flipped
cool - flipped
Wistia - flipped
hot - flipped
afmhot - flipped
gist_heat - flipped
copper - flipped
Qualitative
Pastel1
Pastel2
Paired
Accent
Dark2
Set1
Set2
Set3
tab10
tab20
tab20b
Paired - flipped
Set1 - flipped
Set2 - flipped
Set3 - flipped
tab10 - flipped
tab20 - flipped
tab20b - flipped
tab20c - flipped
Miscellaneous
flag
prism
ocean
gist_earth
terrain
gist_stern
gnuplot
gnuplot2
CMRmap
cubehelix
brg
gist_rainbow
rainbow
jet
turbo
nipy_spectral
gist_ncar
flag - flipped
prism - flipped
ocean - flipped
gist_earth - flipped
terrain - flipped
gist_stern - flipped
gnuplot - flipped
gnuplot2 - flipped
CMRmap - flipped
cubehelix - flipped
brg - flipped
gist_rainbow - flipped
rainbow - flipped
jet - flipped
turbo - flipped
nipy_spectral - flipped
gist_ncar - flipped
Diverging
PiYG
PRGn
BrBG
PuOr
RdGy
RdBu
RdYlBu
RdYlGn
Spectral
coolwarm
bwr
seismic
PiYG - flipped
PRGn - flipped
BrBG - flipped
PuOr - flipped
RdGy - flipped
RdBu - flipped
RdYlBu - flipped
RdYlGn - flipped
Spectral - flipped
coolwarm - flipped
bwr - flipped
seismic - flipped
Cyclic
twilight
twilight - flipped
twilight_shifted
twilight_shifted - flipped
hsv
hsv - flipped