Shadow Maps



[Print This]

For GIMP Versions: 2.2, 2.4; see update at bottom for 2.6

Two variations on this tutorial.  We'll be creating the one on the right.

In the real world, shadows are often cast across uneven surfaces, taking on the shape of the surface. While adding a typical drop shadow is a piece of cake with GIMP, mapping it to an uneven surface takes a little more work. But just a little.In this tutorial we’ll use some techniques from the previous one to create some interesting text, but it’s what we do with a drop shadow from that text that you’ll be most interested in. The examples here show variations of the effect. We’ll be making the less dramatic one on the right-and I’ll explain why when we get done.

Creating the Background and Text

In a new default canvas window, make a rectangular selection. We want to create a selection of a precise size.  To do this, choose the Scale tool from the Toolbox and in the Tool Options dialog set its Affect option to Transform Selection. The Scale tool can work on layers, selections or paths so you should check the Tool Options dialog to make sure you’re changing what you expect to change when using this tool.  Click in the selection to open the Scaling Information dialog. Set the Current Width and Current Height to 50, then click the Scale button to apply the change.

Sizing a selection to a precise size can be done using the Scale tool.
Select the ContraWhirl pattern from the Patterns dialog and drag it into the selection. Use ctrl-C to copy the pattern-filled selection and ctrl-V to paste it. Make the pasted layer a new layer (Layer->New) and name it ContraWhirl.

Fill the selection with the ContralWhirl pattern (shown on the right, in the Patterns dialog).

Scale the new layer to the size of the canvas (Layer->Scale Layer). Open the Align Visible Layers dialog (Layer->Align Visible Layer). Set both the Horizontal and Vertical Styles to Collect and the Horizontal and Vertical Base to Center. Enable both the Ignore bottom layer and Use bottom layer options. Press OK. Setting the styles to Collect and the base’s to Center will precisely align the new contrawhirl layer to fit in the Canvas window. Now delete the background layer.

The ContraWhirl pattern replaces our white background.

Desaturate the ContraSwirl layer (Layer->Colors->Desaturate). Open the Gaussian Blur dialog (Filters->Blur->Gaussian Blur). Set the Horizontal and Vertical options to 7 and apply the filter to the layer. Reset the default foreground and background colors by typing D in the Canvas.

The blur will soften the lines in the pattern, which can become pixelated when scaled up.

Select the Text tool from the Toolbox. In the Text options, choose a font appropriate for your project. I’m using URW Palladia L Bold here, set to size 60. As in the other tutorials in this part of the book, this particular font allows the effect to be seen more easily. Click in the Canvas and type WaveMaker in the Text Editor. Close the Text Editor. Using the Move tool, drag the Text layer to the center of the canvas.

The text will act as a source for the shadow we'll map to the wavy background later.

Adding Depth to the Text

The next series of steps will use offset duplicate layers to make the text appear three-dimensional. If you simply want to map a shadow to your text, you can skip ahead to the next step.

Duplicate the text layer (Layer->Duplicate). Click on the Keep Transparency button in the Layers dialog. In the canvas, type ctrl-A to select the entire layer. Drag the Background color into the layer to change the text color to white. Offset this layer (Layer->Transform->Offset) by 1 pixel in both the X and Y directions and deselect it. Set the layer boundary to match the image size (Layer->Layer to Image Size). Turn off the Keep Transparency button. Blur (Filters->Blur->Gaussian Blur) this layer by 2 pixels.

A light blur is applied to the duplicate text layer.

Click on the original Text layer to make it active. Duplicate this layer again. Click the Keep Transparency button again and select the entire layer again. Don’t change the color of the text this time. Offset the layer by -1 pixel in both the X and Y directions. Deselect. Set the layer boundary to the image size. Turn off the Keep Transparency button. Blur the layer by 2 pixels. Lower this layer to just below the original text layer by shuffling the order in the layer dialog.

The new layer acts as a shadow layer and gives a slight appearance of depth to the text.

Create a selection of the original text layer (Layer->Transparency->Alpha to Selection). Click on the White duplicate layer to make it active. Type ctrl-X to remove the selection from that layer, leaving just a white outline. Repeat this process for the Black duplicate layer.  The overall affect should look like recessed text with light shining from the left (thus lighting the right edges of the lettering).

The white text changes into a white edge to the text.

Adding and Mapping the Drop Shadow

Now we’ll work on the shadow that is the real point of this tutorial. Create a drop shadow of the original text layer (Script-Fu->Shadow->Drop Shadow). Set the X offset to 3, the Y offset to 30, and the Opacity to 80. Disable the Allow Resizing option. Click OK to create the shadow layer. Change the layer size of the shadow layer to be the same size as the canvas (Layer->Layer to Image Size).

The drop shadow is created from the original text layer.

Open the Displace filter (Filters->Map->Displace). Set the X and Y displacements to 15. In the menus next to each displacement field, choose the ContraWhirl layer. This will be used to map the the shadow to the ContralWhirl layer. Apply these settings. The shadow will be mapped to fit the apparent contour of the ContraWhirl layer.

Mapping the shadow requires use of the Displace filter.

To complete the basic effect, we can add color. Click on the ContraSwirl layer. Select the entire layer (ctrl-A). Click on the Foreground color to open the Change Foreground Color dialog and set the RGB values to 29/174/176, which creates a color similar to aquamarine. Close the dialog. Choose the Bucket Fill tool from the Toolbox. In the Tool Options dialog set its Mode to Overlay, its Fill Type to FG Color Fill, and the Affected Area to Fill Whole Selection. Click on the canvas to colorize the ContraSwirl layer. Deselect.

Color provides a mood to the image.
Click on the original text layer. Select the entire layer. Click the Keep Transparency button. Select the Golden gradient from the Gradients dialog. Click on the Gradient Tool in the Toolbox. Set the Shape to Radial. Click in the upper left corner of the layer and drag to the lower right. Deselect. Set the layer boundary to match the image size.

Coloring the text adds more mood.

Coloring the text adds more mood.  But as you see here, a pattern can be used to add color just as easily as using the foreground and background colors.

Exploring Shadow Maps on Your Own

The effect here is less dramatic than it could have been (as shown in the alternate example at the start of this tutorial). Why? Because the shadow map depends on the variation in the ContraWhirl pattern. To change the mapping, you could apply the ContraWhirl pattern to the background first, then create a square selection over an interesting part of the background, copy and paste it as a new layer. Then proceed with the rest of the tutorial.

So why didn’t I do that here? To show you that some of these tutorials take experimentation-and a little patience. If the effect isn’t quite right, you need to understand how the effect works. Then you can modify the process to fit your needs. Now that you know how shadow maps work, you’ll always be able to find one that works for your own projects.


Update for GIMP 2.6

  • The Align Visible Layers dialog from 2.2 and 2.4 has been replaced by the Alignment Tool in the Toolbox.  It’s easier to use too.
  • The Keep Transparency button in the Layers dialog is now labeled simply Lock: and has a small white square to its right.  Click on that square to Lock transparency for the currently selected layer.  This is the same feature as Keep Transparency but in a slightly different location in the Layers dialog.
  • The Script-Fu menu has been merged with other menus.  The Drop Shadow filter can now be found under Filters->Light and Shadow, which makes a bit more sense.


Related posts

Leave a Comment