Creative Coding With DCTL: Part 1

May 25, 2021

Cullen Kelly kicks off a new exciting series about DCTL coding. Learn the vocabulary, syntax, and techniques to create DCTLs to aid your color grading.


 A Step By Step 10-Part Series To Create A Creative DCTL

Welcome to the first installment of Creative Coding With DCTL!

Over the course of this ten-part series, we’re going to learn what DCTL is, how it works, and how we can use it to develop custom creative tools.

At the end of this series, you’ll walk away with not only a new skill set, but a fully functional ‘Filmic Contrast’ tool that allows a user to dial film-print-like contrast into their image, and to push a custom cocktail of blue/green into the shadows and red/green into the highlights.

In our first few installments, we’ll be focusing on the core concepts needed to begin coding. While it may be tempting to skip ahead to the hands-on lessons, take my word for it as a self-taught coder that these concepts are critical to successful and pleasurable development, and it’s far easier to learn them now than when you’re staring down a few hundred lines of misbehaving code with no clue how to troubleshoot them.

We’ve got a lot to cover, so let’s dive in!

What Is DCTL?

  • DCTL, or the Davinci Color Transform Language, is a programming language created by Blackmagic Design that allows Resolve users to perform mathematical operations on image data within the Resolve ecosystem. It’s based on CTL (Color Transform Language), which was developed for a similar purpose, albeit not specific to Resolve.
  • DCTL is what’s known as a high-level language, meaning it’s reasonably easy to read and write — at least in contrast to low-level programming languages such as assembly language. However, like all programming languages, DCTL has highly specific conventions and syntax, and even small deviations from these will usually result in errors.
__DEVICE__ float3 transform(int p_Width, int p_Height, int p_X, int p_Y, float p_R, float p_G, float p_B)


float3 rgb = {0.f, 0.f, 0.f};

return rgb;


Above is a simple DCTL script that returns solid black pixels regardless of input.

org 0x100
mov dx, msg
mov ah, 9
int 0x21
mov ah, 0x4c
int 0x21
msg db 'Hello World!', 0x0d, 0x0a, '$' ;-terminated message

An assembly language “Hello World!” program.

  • DCTL code is written in a plain text editor,  then saved with a .dctl extension so that Resolve can recognize and use it. A functional chunk of code saved in this way is known as a script, program, or most commonly, a DCTL. It’s worth noting that most of the time, when you hear DCTL mentioned, people are talking about specific scripts written in DCTL, as opposed to the programming language itself.

What Can DCTL Do?

In a broad sense, DCTL has only one capability: the continuous input, manipulation, and output of pixel data inside of Resolve. It can also present one or more UI elements to the user (such as sliders, drop-down menus, and checkboxes), and incorporate the user’s choices into its manipulation.

Here are a few examples of tasks we might perform with a DCTL:

  • Applying lift, gamma, gain, and/or offset to an image based on user input
  • Generating a solid color and completely overwriting the input image
  • Applying a LUT

What Can’t DCTL Do?

While the above is a fully comprehensive definition of DCTL’s capabilities, it’s worth singling out out some of the functions that don’t fall under that umbrella:

  • Outputting anything other than pixel data back to Resolve. It’s not possible to write metadata, save files, or output text.
  • Computationally expensive operations. This is not a hard limitation, but because DCTL continuously processes every pixel, there’s a level of complexity past which performance will get sluggish and your system may become unstable. Long story short, it’s entirely possible to write a “valid” DCTL that will freeze or crash your system.

What Do I Need To Build A DCTL?

Here’s what you’ll need to follow along with this series:

  • Davinci Resolve Studio (the free version of Resolve doesn’t support DCTLs).
  • A plaintext editor — I recommend Sublime Text
  • A basic grasp of arithmetic, including power functions and logarithms. We’re going to do a refresh on these, but you should know upfront there’s no way to avoid math when creating DCTLs.
  • A clear concept of what you’d like to build. This is vital to successful DCTL development. New coders struggling to realize a tool often get fixated on what’s wrong with their code, but far more often their problem is a fuzzy concept. 
  • A process-oriented mindset. Another inevitable reality of coding is that it takes time. The process is never linear and typically involves multiple detours and roadblocks. We have to learn to accept and enjoy this process, rather than seeing it as a barrier to our result.
  • Optional: a Github account and a copy of Github Desktop. This isn’t strictly necessary, but it’s the way I’ll be publishing code throughout this course, and it’s a great platform for sharing, debugging, and tracking changes to your scripts.

Now that we’ve answered these basic questions, let’s get acquainted with the key building blocks of any DCTL.

Member Content

Sorry... the rest of this content is for members only. You'll need to login or sign up to continue (we hope you do!).

Membership options
Member Login


Hundreds of Free Tutorials

Get full access to our entire library of 900+ color tutorials for an entire week!

Start Your Free Trial