LUTRecover v1.0

This location is for Registered Users Only.
Perhaps you need to login or register.
Contributor: Haarm-Pieter Duiker
A Blink script that will recover a 3D LUT by comparing two images.
9.0, 8.0 or later
01 Sep 2015

LUTRecover will recover a 3D LUT by comparing two images.

Have you ever found yourself without a LUT, but with two images that represented a project before and after the LUT was applied? LUTRecover will recover a CMSTestPattern-style 3D LUT by comparing the color in 'before' and 'after' images.


The before and after images should have matching resolution.

The recovered 3D LUT will be more accurate given more color range in the 'before' image. In the examples below, we use a CMSTestPattern image for the before and after to make sure that we have full coverage for the input range. Real world examples won't cover as much range, but should still produce a meaningful LUT. 

The resolution set in the CMSTestPattern image will determin the resolution of the recovered 3D LUT.

This node can be passed directly to a GenerateLUT node if you want to then write your LUT to disk.

This script iterates over every pixel in the 'before' and 'after' images for each pixel in the CMSTestPattern-style 3D LUT image, so it stresses the limits of what Blink/OpenCL/your GPU can handle in a reasonable amount of time. If you are getting errors related to OpenCL, you can either downres your before and after images or uncheck 'Use GPU if available' on the 'Kernel Parameters' tab of the LUTRecover BlinkScript node.


The Blink source code is available on Nukepedia and on github here:

Example Nuke Script

An example Nuke script can be downloaded from github here:

Example Images

Here we have the 'before' and 'after' images. We use a CMSTestPattern image for the 'before' to make sure that the full range of input values is covered for the example.

LUTRecover rawImage LUTRecover gradedImage

The first CMSTestPattern image below that is used to determine the resolution of the recovered LUT. This example uses resolution 33. The second image is the recovered LUT. This can be fed into a GenerateLUT node to write the LUT to disk or a LUTApply BlinkScript node to compare the recovered LUT to the graded 'after' image, which is the third image below.

LUTRecover identity LUTRecover recoveredGrade LUTRecover comparisonGradedImage


The MIT License (MIT) Copyright (c) 2014-2015 Haarm-Pieter Duiker Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please login in order to download these files.


0 # Sebastian Thaler 2021-11-24 16:21

is it also possible to compare also a a pair of sequences and generate a LUT out of it?
Something Like MatchLight form Light Illusion?


You have no rights to post comments

We have 2571 guests and 35 members online