December 2006

Gradient-masked linear light blur

Looks like I’ve been using the Gradient and Gaussian Blur nodes in all the previous posts. This one, therefore, is the logical combination: masking a linear light blur with a gradient. I promise to write about something that doesn’t involve blurs and gradients next time…

Let’s take another random boring image from my snapshot archive:

In 30 years, this locomotive is automatically going to look quaint. But we can’t wait, we want sappy nostalgia today. So bring on the Conduit Digital Aspartam Coating — good for your teeth, unbearably sweet, with unknown side effects due to prolonged exposure:

The recipe is on the left. Many of the ingredients are familiar if you’ve read my previous posts. Gaussian Blur and the Video->Linear->Video nodes were covered here; Gradient was used here.

Looking on the right, where the input image comes in, we see two different processing paths: one with Levels/Channel Mixer/Gaussian Blur, while the other has Levels/Saturation/Multiply. These are then combined using an Over node. The Over node does regular alpha (=transparency) compositing — same thing as the Photoshop “normal” blending mode.

In this case, the top image doesn’t have an alpha channel, so Over gets the alpha from the node’s middle input. The cyan color indicates that this is a scalar input: you can’t connect a color into it, it has to be a plain number value. Because the value I wanted to use for alpha is a color generated by the Gradient node, I had to add a Scalar node to handle the conversion explicitly. (Scalar is a convenience node that simply takes the red channel from the original image; if you actually want the image’s brightness, you should use a Luminance node.)

Between Gradient and Scalar, there’s a Bezier Curve node. I’ll probably make another post about the curve nodes later, so for now, I’ll just show pictures of what this node is doing here. The original gradient is on the left, in the middle is the curve specified for the node, and on the right, the result:

Going back to the right-hand side of the conduit again, there’s a few different color correction nodes applied to both processing paths of the image. On the blur side, there’s a Channel Mixer, which is used to give the image a bluish tone. On the non-blurred side, there’s Saturation and Multiply with a yellow color for that sunset atmosphere. The blurred image is also heavily darkened; that’s why there are two separate Levels nodes (the tone modification applied on the non-blurred side is much more modest).

Maybe this conduit would be more useful if the gradient were vertical instead of horizontal. That’s easy to change in the Gradient node. Let’s try it on another image:

The blur looks rather lumpy here, but I don’t mind — I just wish it were summer… Well, Merry Christmas! As a modest present, here’s the .conduit file for this effect.

Color correction
Conduit

Comments (0)

Permalink

Secondary color correction

Primary and secondary color correction are the cornerstones of video color manipulation terminology: primary correction means all the adjustments that affect the entire image, while secondary correction refers to adjustments that target a specific color range. By this simple definition, it’s obvious that there’s a conceptual overlap with keying, which is also all about isolating specific color ranges. Conduit has all these convenient keying nodes, so maybe they can do double duty in secondary color correction? Let’s see…

Here’s a French aluminium factory. The storyline says it’s inhabited by a freedom-hating gene-manipulating aluminium tycoon, so we should make it look a bit more eerie while still keeping the overall daylight mood intact. How about replacing that rusty orange color with something else?

Quick rundown of what’s happening here: the input image is keyed against a bright orange color, the resulting mask is inverted, and then a bright blue color is composited using this mask over the original image.

What does the 3D Key node do exactly? It creates a mask based on the distance of the two input colors in 3D space. To visualise it, imagine a cube whose XYZ dimensions correspond to RGB. The cube is of unit size 1, and thus contains all the RGB color values between 0 and 1. What “3D Key” effectively does is to interpret the two input colors as points within that cube, and the distance between those two 3D points becomes the matte value.

But wait, you don’t have to visualise it yourself — Conduit’s Plot window has a Cube mode which gives you exactly the kind of RGB color cube that I described above. On the left is the original color cube, and on the right the cube after the 3D Key was applied:

It’s like someone took a bite out of the orange side of the cube… That is simply what the 3D Key does: it isolates the colors within a certain distance of the key color (orange, in this case).

However, we were supposed to do some important secondary color replacement stuff here, not just play with cubes. Going back a bit, the conduit shown above simply replaced the oranges with a solid blue color. It looks like this:

This solid look could be interesting as a stylised effect, but in this case, we’d like to have something just a tad more realistic while still bizarre. In the above image, the replacement color looks really bright on the wagons, but too dark in the fences on top of the factory. So let’s use a gradient instead of a solid color, and also mix it with the original image.

Ok, so now the orange is replaced with a subtle blue-grey gradient. There’s still nothing very “out of this world” about it, though. Maybe we can make the replacement color glow and ooze a bit with a Gaussian Blur…

The above greyscale image shows the blurred mask. The blur node’s Vertical Aspect parameter was set to a value above 1, which stretches the blur vertically. The blur also has a bit of “boxiness” (the Boxiness slider allows you to make the Gaussian Blur look more like a Box Blur, a.k.a. Fast Blur).

The result image:

Good enough to be the backdrop for an evil industrialist? Maybe not yet. But the beauty of compositing with nodes is that it’s so easy to keep tweaking with the effect until you’re really satisfied. It’s hard to see how a traditional color correction package would have allowed us to get the above result — with fixed-function software, you run against the program’s limitations usually sooner rather than later.

Again, now that we have this “rust replacement” effect built, we could easily apply it to all the other shots that we have of this factory. If we were making a full-length feature, the accumulated time savings could be enormous compared to the case where we had to rebuild effects using layers and filter stacks for each and every shot.

(Click to download .conduit file)

Color correction
Conduit

Comments (2)

Permalink

That old glow… With a linear twist

Building a simple highlight glow effect is very easy using Conduit nodes:

First the highlights are isolated with Levels, then blurred, and finally composited on top of the original image using Screen blending. Screen is a familiar operation to all Photoshop users: it’s similar to Add, but whereas Add easily results in oversaturated colors and clipped whites, Screen effectively cuts the top layer’s opacity as its color values approach white, thus resulting in a more pleasing appearance.

This is what it looks like:

Well, it’s a regular glow, not too terrible for an effect that can be created with three nodes and easily reused whenever you’re in the mood to add some ’70s styling for your productions. Now, you might recall that Conduit is a cutting-edge floating point HDR compositor. Perhaps you’re asking yourself: “What if we used linear light for this effect, like all the cool people are doing nowadays?”

“Linear light” essentially means working with your images in a colorspace that closely resembles the original light intensities seen by the camera. Many people think that compositing with a linear light workflow results in more organic imagery that’s closer to traditional photographic processes, as opposed to the “digital video” look.

So let’s put it to a test by converting the glow effect to linear light. At the top and bottom of the conduit, we now have the crucial Video->Linear and Linear->Video nodes that handle the colorspace conversion between regular “video” color and linear light. The Levels and Gaussian Blur are the same, with one important difference: the Levels node is no longer marked in red, which means that its output is no longer clipped into the standard 0-1 range, but instead it outputs color values that go below zero and above one — that’s possible with floating-point color.

After the Gaussian Blur, there’s now a Clip node which clips those floating-point values back into standard range before they’re composited over the original image. Otherwise the negative color values will have some unexpected results (which I’ll show later).

The last change done is to replace the Screen node with Add. The Screen algorithm assumes that color values are strictly within the standard 0-1 range, so we can’t use it in a HDR effect. Instead, we’ll just use Add — in fact, Screen was originally introduced in Photoshop with the aim of simulating the look of images added in linear light, so in this case Add is truly “the real thing”.

Ok… So how does it look? Roll over with mouse on the image below to see the linear light version.

You don’t necessarily have to be impressed with the linear light version — there’s no right or wrong answer here, they are just different looks… Also, this example was deliberately subtle. Let’s try it with another image. Original:

With glow (again, rollover with mouse to see linear light version):

I find the linear light version nicer because it preserves the highlight detail, making the sky look more realistic and overall it has less of a video filter appearance. But sometimes a strong visible glow may be just what you want… You can download the .conduit file and try it yourself.

Oh, what about the linear light version if Blur’s output wasn’t clipped, which I mentioned above? Here’s what it looks like:

Without clipping, the negative color values created by Levels are propagated down to the Add node, resulting in these deep dark areas. (Obviously, when negative values are fed into Add, it becomes Subtract.) So watch out for those rogue negative HDR values!

Conduit

Comments (1)

Permalink

Gradient mapping

The Gradient node in Conduit does just what the name implies: it renders a linear gradient. There are three color inputs at the top of the node, and plugging in color values determines the colors that the gradient blends between.

However there’s also a fourth input called “bias”, which is not so self-explanatory. Here’s how it works: when a value is plugged into “bias”, the gradient function gets computed for each pixel at the bias input position, rather than the pixel’s position within the image (which is how a regular gradient works).

Don’t worry if that explanation doesn’t make a lot of sense — we’ll look at some practical examples in a moment. The most obvious use for this feature is to have an image’s luminance driving the gradient bias input. This effect is called “Gradient Map” in Photoshop.

So, let’s try it with this ugly image. The ugliness is a deliberate shock tactic, to try to keep you interested if we can do anything to make this look better:

By plugging in two gradient colors and the image’s luminance for gradient bias, we get this duotone look:

Or, with three gradient colors, we have a tri-tone:

By the way, if you look at the color values for the bright yellow color (shown on the right), you can see that it is a actually a HDR (high dynamic range) color — the red and green values go beyond 1.0. If the color was clipped to standard color range, the node would look the same in the Conduit Editor UI, but the highlights of the resulting image lose their punch:

In Conduit, you can always use an image in place of a solid color, so let’s try plugging some image data into one of the gradient’s color inputs. Here’s what it looks like with the original image as the middle color in the gradient:

What effectively is happening here is that the image’s shadow and highlight tones are mapped to the two colors connected to the gradient, while midtones remain as they were.

Finally, let’s add a hint of dark blue misty ambience. With a Gaussian Blur applied to the shadow and midtones, and a Multiply to make the shadows darker, we have the following image… I don’t know if I’d call it beautiful, but it’s definitely less of an eyesore than the original image we started with!

The conduit now looks like this:
(Click here to download the .conduit file)

You can see in the above image that I added a separate Number node to control the gamma value of the Levels node preceding the Gaussian Blur. I did that because I thought that value was interesting to play around with (and also because it gave me a good opportunity to use a “wire note”, that turquoise label hanging there — you can add them by right-clicking on any wire in Conduit).

Below are some variations from the same image by changing the “blur gamma control” value. If you wanted to animate this, it’s possible: just replace the Number node with a Slider node, and then place keyframes in the host application (Final Cut Pro or Motion).

Color correction
Conduit

Comments (3)

Permalink

Introduction

…Hello. Anybody there? The stage lights are so bright, I can’t see you. Ahem. Thanks for showing up.

My name is Pauli Ojala, and I’m the guy in charge of a small company called Lacquer specialising in visual effects software. Our first product is Conduit, a plug-in that provides a node-based compositing environment directly inside Apple’s Final Cut Pro editing software. In addition to being convenient and affordable, Conduit is also fully GPU accelerated so it’s pretty much the fastest compositor you can find. (Don’t take my word for it — download the trial from our publishing partner dvGarage’s site and see for yourself.)

In this blog, I’d like to present some cool Conduit features and tricks. Some of the upcoming tips may already be familiar to you if you’re a member of Pixel Corps, as they have been posted in the Conduit forum there.

I’m going to provide .conduit files whenever possible, so you can try these ideas in your own projects without having to rebuild them from scratch. After all, easy reuse of effects (”build once, use forever”) is one of the major reasons why node-based compositing is so cool… But I hope to be able to show you a couple of other reasons too.

General

Comments (0)

Permalink