Color correction

Conduit Suite & Photoshop

So, the big update on which we’ve been working for quite a while has been released. It’s called Conduit Suite, and it significantly expands Conduit’s reach: in addition to the existing plugin which works in Final Cut Pro and Motion, the Suite includes plugins for After Effects and Photoshop, as well as a brand new standalone application, Conduit Live. (To see Conduit Live in action, check out this video tutorial by dvGarage.)

The After Effects and Photoshop plugins are also available for Windows. These are not crippled ports: they offer the same Conduit Editor user interface. Conduit’s rendering backbone, the Conduit Pixel Engine, has been ported to Windows’s native graphics interface Direct3D, so you’re getting the best GPU rendering performance available on the platform just as with Conduit on the Mac.

The Conduit Suite gives you access to Conduit in 7 different applications: FCP, Motion, AE/Mac, PS/Mac, AE/Win, PS/Win, Conduit Live. Of course the same effect setups (.conduit files) work in all these applications, so it doesn’t matter where you build an effect, you can deploy it practically anywhere.

Interested yet? Our partner dvGarage is running a pretty hot sale: the entire Suite is only 149 USD until February 20, 2008. (For only $50 more, you can also get dvMatte Pro 3 for true keying nirvana!)

- -

Anyway, enough with marketing and on to the real content: to celebrate the occasion, I’d like to show something simple with Conduit inside Photoshop. Let’s start with this snapshot I took some years ago:

We’d like to place the lion in another background, so in practice we’ll just key out the sky:

I’m using the 3D Keyer because it’s easy and quick for keying out an arbitrary color. Levels is used to tweak the matte’s black/white points, and Exposure is used to tweak the layer’s color — nothing special going on there.

So what happens at the end of the conduit? Set Matte is used to apply the key matte to the image, and then it’s fed to the output. This means we’re giving back to Photoshop an image with an alpha channel. The actual compositing of the keyed lion over the background happens in Photoshop. Here’s what it looks like in Photoshop’s layers panel:

IMO this technique makes a lot of sense because it combines the strengths of Conduit and Photoshop.

Another thing: notice the label “Smart Filters” in the screenshot above? In Photoshop CS3, Conduit works as a non-destructive smart filter: you can go back and edit the effect in the Conduit Editor simply by double-clicking on the Conduit label in the layer’s properties. It’s like Adjustment Layers in Photoshops of the past… Except that Conduit has a hundredfold more capabilities than Photoshop’s simple built-in adjustments. (Thank you Adobe, I love smart filters!)

So here’s what the composite looks like, with the roughly keyed lion over a very plain gradient background:

Hmm. I think the lion and those white clouds might look nice with some glow, and maybe I could experiment with the color a bit. Well, those smart filters definitely come in useful; I’ll just open the Conduit Editor and add some nodes…

(Figuring out what’s happening here is left as an exercise to the reader.) Here’s the final image with a text layer added:

To recap, this Photoshop composite contains three layers: the background gradient, the text, and the lion. The only filter used is Conduit, which was applied to the lion layer. The node tree shown above does all the hard work: keying (sky removal), glow, color adjustments.

Are you seeing the benefits yet? We could have accomplished something similar with a combination of adjustments, filters and selection tools in Photoshop… But by building it in Conduit, everything happens within a single interface.

This way, the effect is also eminently reusable. Just save it as a .conduit file and it can be applied to another layer in another Photoshop document… Or a layer in an After Effects composition… Or a video clip in Final Cut Pro… Or even a live HD video stream in Conduit Live.

Color correction
Conduit
Mattes
Photoshop-specific

Comments (2)

Permalink

Masking with per-pixel gamma

We’re getting ready to release a new version of Conduit. In addition to supporting more host platforms, this 1.6 update makes some new features available to current users of Conduit for Final Cut Studio. There’s no upgrade cost, it will be a free download.

One of these new features is the Embedded Image node. It allows you to load an image directly into the conduit — no more need to put still images in the plugin’s image wells!

Once an image is loaded into an Embedded Image node, it stays as part of the .conduit file (there’s no dependency on the original file). This is highly convenient for images that are part of the effect, such as a mask used to create a specific look. This post shows one example.

As you may already know, most nodes’ parameters in Conduit can be driven by an image. This allows a wide range of interesting per-pixel effects that are essentially impossible in traditional graphics applications. For example, in After Effects you can apply a gamma to the entire image… But what if you wanted a different gamma value applied to each pixel?

While impossible in AE, it’s a breeze in Conduit. To demonstrate, I’ll reuse this image which previously made an appearance in this post:

Here’s the mask — just a plain ellipse drawn in Photoshop, rotated and blurred:

To control each pixel’s gamma value with this image, we just need to plug the image into the Gamma node’s gamma parameter. I’d like to perform this operation in linear light colorspace, so I also need two colorspace conversion nodes. Here’s the effect:

(Notice the blue node? That’s Embedded Image.) Ok, clearly the mask image is much too contrasted, we don’t want the image to go all black in the corners. Some tone adjustment nodes should take care of that…

 

The mask image’s black level was raised and its steep falloff flattened. These are the settings for the Bezier Curve and Levels nodes.

 

What next? Maybe we could add a color tint using the same mask. For basic tinting, the Multiply node works just fine. But the mask we have is black & white — to get a duotone color image from it, we can use the Gradient node to map the black/white into colors (this technique was discussed in more detail here). The colors chosen here are light orange tones:

The result image:

Out of curiosity, what would this effect look like if we didn’t use the linear colorspace? That’s easy to find out by simply bypassing the Video->Linear and Linear->Video nodes…

This look is more artificlal, with steeper contrast and greater saturation variation in the shadows. But since Conduit is non-destructive, you can always keep experimenting to find a happy medium between these looks: things to try might be tweaking the colors plugged into the Gradient node, or entering different values for the “gamma” parameter in the Video->Linear->Video conversion nodes.

Color correction
Conduit
Mattes

Comments (0)

Permalink

Introduction to curves

Many are probably familiar with the Curves tool as found in Photoshop and After Effects. Curves are powerful because they let you control the tone values of the image with much more precision than other typical adjustments such as Levels. The curve is actually a function which maps the original luminance values (on the X axis of the graph) onto new values (on the Y axis). But don’t be afraid of the mathematical definition – the easiest way to understand how the Curves tool works is simply to try it yourself. Place a point in the top-left quarter and pull it up, and you’ll see the image’s highlights getting brighter. Do the opposite in the bottom-right corner, and the shadows will get darker.

The curve nodes in Conduit obey the same logic as in those Adobe apps I mentioned above, with the difference that we offer several variants of curves which have slightly different characteristics. The main reason for this is that Photoshop/AE traditionally operate only on 8-bpc images, whereas Conduit works purely in a 32-bit floating point HDR color space. So while Photoshop can get away with using a precomputed low-precision lookup table (LUT) to perform the curve operation, Conduit actually computes the function separately for each pixel. What you gain is perfect precision: operations in Conduit never produce banding, and the effect of the curve is accurately applied down to the most minuscule tone variations.
(By the way, Photoshop’s reliance on old-fashioned lookups is the reason why Curves – and most other adjustments – are not available when working on 32-bit HDR images in Photoshop CS2.)

The most basic curve is the Cubic with no scaling and no weighting:

You can move any of the four control points vertically, but that’s all. Although that sounds limiting, it’s enough for a lot of typical needs. What you gain by using this no-frills curve is performance: this plain Cubic consumes as little as 3-4 GPU instructions. (Whether that matters at all depends completely on your GPU hardware — I’ll talk about that in a moment.)

When you need more flexibility, the Cubic stretches further by enabling “X weighting”:

In this mode, you can move the two control handles in the middle horizontally, but they always move together (=the distance between them can’t be modified). The price you pay for this degree of freedom is a few more GPU instructions.

You can also modify output levels (i.e. move the start/end points of the curve horizontally) by enabling “X scaling”:

If the tricked-out Cubic isn’t enough for you, you’ll have to move up to the Bézier curve, which lets you manipulate the two control handles independently:

Bézier Curve can cost up to 16 GPU instructions, so it’s one of the most computationally expensive nodes in Conduit.

Whether you need to care about the instruction count depends purely on the graphics hardware in your system: on older GPUs you’ll start to see rendering performance slow down if the number of instructions used by your conduit grows too large. The ATI Radeon 9600/9700 are particularly vulnerable to large instruction counts. OTOH, on more recent GPUs such as the NVidia Geforce 6800 or Radeon X1600 you shouldn’t have any problems even if you go nuts with Béziers. Still, it certainly doesn’t hurt to use Cubics if you can – just think, having the GPU doing less work could result in savings of 0.0000214% on your power bill ;)

The Cubic and Bézier curves are only properly defined for input colors that fall into the so-called standard range, i.e. values between 0 and 1. For that reason, you’ll generally want to keep the “Clip input” option enabled. The following screenshot from the Plot view illustrate the point. First, with input clipping enabled:

Without the clipping, the curve math can end up doing unexpected stuff for values outside the standard tone range:

This is a problem only if you need to apply a curve to a HDR image. Of course in Conduit it’s very easy to create HDR values (by intent, or sometimes by accident)… If you need to work with HDR input in curves and can’t accept clipping, an easy solution is to apply Levels before and after the curve so the image values are temporarily scaled within the legal 0-1 range. For example: you know your brightest HDR values are around 6.0, so you would apply Levels with “input white” at 6.0 before the curve, and another Levels with “output white” at 6.0 after the curve.

If you need separate control of RGB tone values, currently you have to use three separate nodes, maybe like this:

As you can see, it’s possible to individually shrink or grow nodes in Conduit to make the graph more readable. These scaling options can be found in the right-click context menu for the selected node.

Finally, an operation that is often handy: use a curve node to select a luminance range from an image, and use the result as a matte:

In this example, the Cubic curve isolates the highlight tones from the image, so the Multiply operation with the bright yellow color doesn’t get applied to the entire image. (With Curves, Multiply, Add and Gamma, you have the “raw materials” to build your own 3-way HDR color corrector with lift/gain/gamma controls and editable range curves. That could be your advanced level homework, if you choose to accept it…)

Color correction
Conduit

Comments (0)

Permalink

Rive gauche looks in HDR

Some people think that video color correction should be exactly what the name says, strictly limited to correcting problems that couldn’t be fixed while shooting: matching color temperature between shots, adding a bit of gain to lighten harsh daylight shadows, and so on.

This seems to be an ascetic school of thought: rather than indulging themselves at the smörgåsbord of digital color manipulation, they refuse it completely and denounce it as destructive to the pure spirit of the transparent cinematic image, or something along those lines. Yet there’s a solid reason why so many directors, colorists and video artists go for those extreme color looks — it helps them deliver the story or emotion better.

The image below is from a DV video shoot. This shot ought to have some kind of emotional impact, but instead it’s severely hampered by its technical shortcomings. The only story it’s telling me is: “Two people are pretending to have sex on a theatre stage… And is that a bluescreen visible behind the velvet curtain?”

I didn’t have much of a vision as to what should be done with this shot, so I decided to try tossing around some “extreme” nodes in Conduit to see what comes out:

High contrast overexposure, grain, and a golden yellow tint — a bit like a Tony Scott movie set in France, perhaps.

Looking at the nodes on the right, you can see that I’m “misusing” the Cineon to Linear node for color correction purposes. Although it’s a tool intended for a very specific colorspace conversion, we can take advantage of its interesting logarithmic tone curve to pop this image’s highlights into High Dynamic Range superbright stratosphere.

The rest of the nodes are easy to explain: Channel Mixer node does the yellow tint, and Over combines the blurred noise with the HDR image. Because the result is HDR, at the end of this conduit, a Linear to Video node is used to apply display gamma to the image.

Next, I wanted to try mixing a different color into the highlights, to make this image less uniform in color. What I got is basically an “inverse glow” — the image is blurred and tinted, and the result is subtracted from the original image. The resulting juxtaposition of deep blue and yellow/orange creates a nice contrast in my eyes (although it might look quite different on your monitor, the blue is frail):

In order to knock down those overexposed highlights, I added a Highlight Knee node. This node’s sole function is to round off superbright HDR highlights in a pleasing way — here is what it looks like when the knee value is set to about 0.8:

Yeah, I think I prefer a more peaceful look to the previous overexposed mayhem. Let’s take it further and use a Saturation node to desaturate the whole image… With the added trick of using the original image’s luminance to drive the saturation amount, so we get non-uniform desaturation:

See how the Saturation parameter is driven by an image value, rather than a plain number value? This effectively gives pixel-level control over the effect, and can be really useful for building more complex effects. Almost all nodes in Conduit allow their parameters to be controlled by images in this fashion — some accept color input, some only scalar (i.e. greyscale) like Saturation here.

I applied this trick a second time, to drive the Levels node by a previous Gaussian Blur. I also played with the blur size a bit, to see if this desaturated look could be better with a larger blur. This is the final image (roll over with mouse cursor to see the original):

Do you like it, or is it too extreme? To me, this has a “Paris 1968″ kind of mood. (But then again, I was born in 1980, so what would I know about the Sixties…)

It’s important to note that this look depends entirely on Conduit’s pervasive High Dynamic Range support. It uses both superbright values — the Cineon to Linear node is generating values that go over 10.0 — and negative values (in the subtracted blur). For comparison’s sake, below the same image without HDR values at the start, that is, the Cineon to Linear node is set to clip to standard 0-1 range… Roll over to see the clipped version:

(The conduit for this effect is available for download here. If you just want to have a look at the nodes, here’s a picture — I’m not putting it inline because it’s quite large.)

Color correction
Conduit

Comments (1)

Permalink

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

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