$ show jedypod/open-display-transform
This repository provides a collection of open-source display rendering transforms (DRTs) and creative look transforms for professional color grading and compositing pipelines, specifically targeting DaVinci Resolve (via DCTL) and The Foundry Nuke (via .nk group nodes). The core functionality converts scene-referred imagery to display-referred output through a pipeline of gamut conversion, tone scale compression, hue processing, purity compression, and display encoding. It includes multiple DRT implementations (OpenDRT, Tesseract, Chromagnon, JzDT) with varying design philosophies, as well as a suite of look modification tools (ZoneGrade, NotoriousSix series, Nayatani HK, etc.) and utility transforms for gamut and log conversion. The code is grounded in color science standards (ACES, ITU-R BT.2100, CIE XYZ) and academic literature, with careful handling of edge cases through safe math functions. While the transforms are tightly coupled to their target platforms and lack automated testing, the shared header files (libDRT.h, libLMT.h) and standalone utilities demonstrate reusable patterns for color conversion and mathematical operations.
The LLM identified 4 files worth highlighting for reuse:
A C header file providing reusable utility functions for color transforms: safe division/power (sdivf, spowf), color space conversion matrices (XYZ to LMS, CAT02 chromatic adaptation), transfer functions (PQ, HLG, gamma), and tone scale helpers. It is included by multiple DCTL files and could be extracted for use in any GPU-based color pipeline with minimal modification.
A C header file for look modification transforms, containing reusable functions for hue angle extraction (extract_hue_angle, power_window), zone extraction (zone_extract for shadows/highlights), and safe math operations. These patterns are used across multiple DCTL look tools and can be adapted for any per-hue or per-zone image processing task.
A standalone DCTL that performs full gamut conversion between common camera color spaces (ACES, Arri, RED, Sony, etc.) with optional chromatic adaptation. It is self-contained, parameterized, and can be dropped into any Resolve project for color space transformation without depending on other internal modules.
The primary DRT implementation with a modular pipeline: gamut conversion, tone scale (with presets), hue processing (contrast, shift), purity compression, and display encoding. While tightly coupled to OpenDRT's parameter set, its individual stages (e.g., compress_hyperbolic_power, hue extraction windows) are well-isolated and could be extracted as reusable building blocks for other DRTs.