Layer effects

Layer styles, part 3

Previous installments in my Layer Styles series showed how to create layer outlines and drop shadows in Conduit. This time I’ll look into two very similar layer effects that Photoshop calls “Inner Shadow” and “Inner Glow”. They preserve the original alpha (transparency) of the layer, applying the effect only on the layer image.

Inner Shadow is a simple variant of the Drop Shadow effect that we built previously. Let’s try it on this simple one-layer composite:

With inner shadow applied…

The conduit for this effect looks like this:

The 2D Transform node is used to move the image towards the bottom right. That determines the “light direction” — the imaginary light casting this shadow is in the opposite direction, on the top left. Then, a Separate RGBA node is used to extract the alpha, and it’s blurred with a Gaussian Blur. Familiar territory so far. (The MinMax node is disabled, but will get used soon enough.) The offsetted-and-blurred alpha looks like this:

This image is multiplied over the original image, which applies the shadow. Finally, there’s the crucial Set Matte node, which is used to restore the alpha of the shadowed image to that of the original image. The last node is a plain old Over to composite this layer over the background.

The inner shadow may not be terribly exciting, but it offers a good opportunity to extol Conduit’s pervasive floating-point capabilities. Here’s a variant where the the image is brightened before applying the shadow. Also, the shadow is not offset with a 2D Transform, but rather shrunk with a 2D Min node. This results in a look where the shadow follows the outlines of the layer (this is effectively the same as Photoshop’s Inner Glow with blending mode set to Multiply):

Notice how color and detail is preserved in the bright areas that were blown out and then darkened by the shadow? For comparison, the following image shows what the effect looks like if the brightened image is clipped. This is the result you get in a compositor that doesn’t support floating-point color:

(Technology insight interlude: many video/graphics editing and compositing packages don’t support floating-point color at all. Those that do usually have a separate floating-point mode, and users avoid using floating-point color unless absolutely necessary because it entails heavy performance hit and more limited features; e.g. many Photoshop and After Effects filters are disabled in floating-point mode. In contrast, Conduit simply defaults to floating-point — you need to explicitly enable clipping in a node if you don’t want high dynamic range color. We can afford to do this because the core of Conduit is a highly efficient concatenation engine that breaks down the conduit into optimized GPU programs. Expensive memory bus traffic is minimized as the pixel data is kept in high-precision GPU registers as long as possible. That’s how Conduit can do realtime HD playback with effects that might take something like 10 seconds per frame to render in a previous-generation compositor like Shake. Now back to the tutorial…)

Instead of just a black shadow, we might want to colorize it. That’s pretty simple to accomplish: just mix a color into the shadow image (the blurred alpha). We’ll use a Screen node for this, because we want to keep the white intact in order to avoid colorizing the entire layer when the shadow is applied. Here’s the shadow image colorized using Screen:

The result image:

And the conduit:

The brightening is accomplished with a Bezier Curve node (which brings down the highlights a bit) followed by Exposure. Here are the exact settings for these nodes, in case you’re curious:

As a tiny reward for the patience you’ve shown by reading this far, here’s a glimpse into one of the new Conduit products that will be released soon. Watch this space! :)

Conduit
Layer effects

Comments (1)

Permalink

Layer styles, part 2

In the previous post (which was much too long ago considering this was supposed to be a regular series of posts…) we built a simple graphical layer style which added a plain black border to a text layer generated in FCP.

To expand upon that technique, let’s turn the black border into a drop shadow by blurring and offsetting the text’s outline:

Drop shadow nodes

The 2D Transform node allows you to move and resize an image. The parameter values are relative to the image size — e.g. to move the image 10% to the left, you’d enter a value of -0.1 for “X translation”; to stretch the image to twice its original height, you’d enter a value of 2 for “Y scaling”, and so on.

For a tiny bit of extra interest, the originally white text was tinted to yellow using a Multiply node on the left-hand side of this tree. As in the previous version, the Over node at the end composites the original text (left-hand side nodes) over the drop shadow (right-hand side nodes).

The subtitle layer now looks like this:

Conduit
Layer effects

Comments (1)

Permalink

Layer styles, part 1

I enjoy playing around with nodes and exploring abstract image processing concepts with the freedom granted by a nodal interface, but I realize that not everyone has a passion for tinkering. I’d like to be able to convince those people that Conduit can also be used to solve everyday practical problems in Final Cut Pro and other host applications.

To that aim, I’m starting a series of posts about “layer styles”. The name comes from the set of effects available through Photoshop’s Layer Styles dialog, which looks like this in my ancient copy of Photoshop 7.0 (the first version of Photoshop that ran on OS X, not so long ago!)…

If I recall correctly, this dialog was added in Photoshop 6. Before that, designers had to manually build and update these effects for each layer — a time-consuming process, considering how common it is to have something like a drop shadow or translucent gradient fill applied to a bunch of layers.

Layer styles would be just as useful in Final Cut Pro, but the only thing we get by default is the “Drop Shadow” settings in the Motion tab for a clip. Luckily, armed with Conduit we can easily build “layer style” effects. Applying a Conduit-created custom effect to multiple clips is as easy as copy&pasting the Conduit effect from one clip’s filter properties into another.

Here’s an image from the brand-new exciting soap opera created by the Anteeksi design collective:

The Finnish-language subtitling is created with Final Cut Pro’s standard tools as a text clip on the topmost track. The problem is that the white text goes unreadable on a light background. A plain black border would be a nice solution, but FCP’s text tool doesn’t offer the possibility.

We’ll apply Conduit to the text clip. In Conduit, we’ll: 1) pull the alpha of the text to get its outlines, 2) use a “2D Max” node to expand the text outlines, 3) fill the expanded outlines with black, 4) composite the original white text on top of the expanded black text.

Here’s how this task is accomplished using nodes in the Conduit Editor:

Basically there’s a node for each of the four steps I described above, and one additional node for the black color. (Instead of a Color node we could alternatively use a Color Picker node, which would allow us to easily change the border color in the Conduit filter’s properties in FCP without opening the Conduit Editor itself.)

Here’s what the black outlines look like. Much improved on-screen readability!

Conduit
Layer effects

Comments (0)

Permalink