Voronoi Gradient v1.2

This location is for Registered Users Only.
Perhaps you need to login or register.
Contributor: Nikolai Wüstemann
Nuke implementation for 2D Gradients. Create an arbitrary number of color-samples in 2D, which will produce a smooth, natural interpolation over the entire image.
11.0, 10.5, 10.0 or later
Linux, Mac, Windows
07 May 2019

Nuke implementation for 2D Gradients.

Create an arbitrary number of color-samples in 2D, which will produce a smooth, natural interpolation over the entire image.

VoronoiGradient 03


The Gizmo uses Natural Neigbor Interpolation to calculate the pixels inbetween samples, using Blinkscripts.

You can also output the underlying Voronoi Diagram.

Another important function is the ability to sample input colors, instead of defining them yourself. Setting the Type to 'Sample' used all created points to sample the input colors at given positions.

Changing the Colorspace will change the color falloff. This can be used to achieve the best artistic result.

There are several tricks used in this Gizmo to make it work, one being a method to feed an arbitrary number of input parameters into a Blinkscript. All types of Nuke scripting are going on here, like Python, TCL, Expressions and Blinkscripts. Please report any bugs you find, I am sure there still are some. The user knobs and the inside of the gizmo are well documented to help with understanding the concept.

Animation on the Position and Color knobs is not supported. I might redo the gizmo as C++ plugin in the future to solve this isse and to introduce a gap-filling method, that assumes every given pixel as sample and fills in holes that are defined by a black alpha.


Using the Sample Type to generate a cleanplate:

SampleType v02


 Update to 1.1

- Fixed the string separator declarations for some Expressions from ',' to

Update to 1.2

- Fixed another Expression I forgot in 1.1

Please login in order to download these files.


# Frank Rueter 2019-05-02 22:32
This is awesome, been wanting this in Nuke forever.
Two things though:
-the "to" points shoe up in the viewer but they don't do anything?!
-it'd be great to implement the "Magic Carpet" functionality of sampling the incoming area under the respective point for the colour rather than having to set it manually.

A plugin version of this would be great to make it a bit faster.
# Nikolai Wüstemann 2019-05-02 23:28
Hi, thanks for your feedback!

The sample functionality is already implemented, just change the Type parameter to Sample :)

What do you mean with "to" points. I expect the viewer to look like the one in the screenshot above.

A plugin would be faster indeed, but the problem lies within the algorithm. My code is short, clean and slow :D
There is a way faster method to calculate the pixels, but its implementation is really hard, so instead I used the brute-force approach, that scales quadratically with image size. In order to reduce the processing time to less than 1s I added the optimization parameter. If you crank that up it will be a lot faster.
# Nikolai Wüstemann 2019-05-02 23:30
If you encounter any bugs or problems, please report!
The whole setup is quite experimental and uses a lot of tricks/hacks in different places, I don't even know how it works on another system.
# Frank Rueter 2019-05-03 00:21
Great. please ignore me, pre-coffee idiocy made me write this stupid comment :-D
Indeed, it's all there and the "to" points in the viewer was user error.
Awesome, this will be a great supplement for IBK workflows, thanks!
# Nikolai Wüstemann 2019-05-03 08:06
You're welcome :)
I hope it will be a simple method to generate cleanplates for keying. Right now I am working on a variation of this tool, to fill in missing information (= black alpha) in an image. This is pretty straightforward , but takes even longer to calculate. As long as I don't come up with speed improvements in the Blinkscript itself.
+1 # Hendrik Proosa 2019-05-03 10:58
I get an error in Sample mode:
ERROR: VoronoiGradient 1.Expression_Sa mpleColor.temo_ expr0: Unexpected '' in '[sample [node sample_image] red... and so on, I'll attach link to screenshot. www.kalderafx.com/vfx/nukegizmos/voronoigradient/voronoigradient_error_01.jpg

Also it seems that animated points are not properly evaluated, image is not refreshed even when I force-refresh and clear cache.
# Nikolai Wüstemann 2019-05-03 12:40
Ahh I guess splitting a string does not need quotation marks for the separator. What Nuke Version are you using anyway? I sill need to test a lot tho.
# Hendrik Proosa 2019-05-03 13:40
I tried it in Nuke 10.5v5, Windows 7
# Nikolai Wüstemann 2019-05-04 12:37
I fixed the Expressions, I hope this issue is gone now.
# Mohamed Abuzeid 2019-05-03 18:47
it's not working here also with sample mode . no result just black result .
working with Nuke 10.5
# bin zhuang 2019-05-05 02:33
# Nikolai Wüstemann 2019-05-05 12:24
Try downloading the current Version, I did some fixes. If the problem still exists, look up the script editor or the console and post the error message here, thank you :)
+1 # Mohamed Abuzeid 2019-05-06 21:34
ERROR: VoronoiGradient 2.Expression_Sa mpleColor.temp_ expr3: Unexpected '"' in '[sample [node sample_image] alpha [value this.parent.pos _[lindex [split [value this.parent.poi nts] ","] [frame]].x] [value this.parent.pos _[lindex [split [value this.parent.poi nts] ,] [frame]].y]] '
# Nikolai Wüstemann 2019-05-07 08:07
Thank you for reporting the error, I just did an update to fix this! 1.2 is available now!
# Mohamed Abuzeid 2019-05-07 19:12
still not working in sample mode .

ERROR: VoronoiGradient 1.Expression_Ge nerateColor.tem p_expr3: Nothing named 'Nothing' in '[value this.parent.col or_[lindex [split [value this.parent.poi nts] ,] [frame]].a]'
# Craig Sylvester 2019-07-16 18:14
Hi. Would like to use this in production, but we're seeing intermittent Expression errors in non-GUI (farm) renders:

Warning: VoronoiGradient 1.SampleBlur: [Blur] Abort/cancel checked with no valid trees. This op most likely needs to have its parent set correctly.
ERROR: VoronoiGradient 1.Expression_Sa mpleColor.temp_ expr0: Nothing named 'Nothing' in '[sample [node sample_image] red [value this.parent.pos _[lindex [split [value this.parent.poi nts] ,] [frame]].x] [value this.parent.pos _[lindex [split [value this.parent.poi nts] ,] [frame]].y]] '

If you have any insight in to this error I'd appreciate the help. I'm also happy to send you files.
+1 # Alexey Kuchinski 2019-05-05 12:55
worked perfectly well on 11.3 linux!
# darren coombes 2019-05-17 02:49
Could a quality knob speed things up for super quick sampling?
Apart from that, amazing!!
# Nikolai Wüstemann 2019-07-02 09:35
The "Optimizaton" knob does this kind of thing. Basically it reformats to a smaller size, does the calculations and scales up again. I'm using the Brutforce method of the Natural Neighbor Interpolation, which scales quadratically in time with frame resolution. All some dirty work :D
# Matthias Wäsch 2019-06-27 10:02
sample mode is still not working with nuke 10.0v6, but works with nuke 11.3v3
# Nikolai Wüstemann 2019-07-02 09:32
Thanks, I'll check it out for the next Version!
# darren coombes 2019-07-02 01:12
Does this sample per frame?
I'm using to try to create a cleanplate of a light on a stage with varying lighting changes, but need to remove some empty seats. Can't seem to get it working to sample per frame.
# Nikolai Wüstemann 2019-07-02 09:31
Hey, yes, this is still an issue related to the nature of Blinkscripts in Nuke. I will fix this in the next version on the "cost" of arbitrarily many sample points. This whole gizmo is a proof of concept anyway, and I'm not happy with the limitations it has right now.

You have no rights to post comments

We have 2668 guests and 115 members online