Chapter 2. Photographic Effects

image with no caption

As a raster image editor, GIMP loves to play with points of color, both individually and in blocks and blobs grouped together in selections. This makes the program perfect for working with photographs. Both your digital camera and GIMP work with pixels, so no data conversion is required. The days of scanning your photos are a thing of the past.

Now that your images are in digital format, there’s no end to the magic you can perform. Going from average photos to studio-quality productions requires just a few techniques that anyone can learn to use. Many techniques are based on simple color corrections like those provided by the Curves, Levels, and Color Balance tools.

In addition, you can use various GIMP filters to enhance photographs. The Retinex tool (Colors▸Retinex), for example, normalizes colors in order to enhance focus. Originally produced by NASA’s Langley Research Center to enhance images taken through smoke and haze, this filter has interesting possibilities for portrait enhancement.

The following tutorials describe techniques that photographers will find useful. Along the way you’ll create vignettes, add focal blurs, adjust color, insert lighting, simulate depth of field and motion, and use cloning methods to clean up damaged photos. Unlike previous tutorials, these won’t start with a blank canvas at the default dimensions and walk you step-by-step through a repeatable process. Instead, I’ll start with a few basic images and apply standard processes that you can use with your own images.

We’re not all professional photographers or graphic artists. You may not have $5,000 digital cameras or fancy studios, but you do have access to many of the same digital effects professionals use: selections, blurs, masks, and layer modes. Taken by themselves these don’t seem like powerful tools. But when you apply them to your own photographic masterpieces, they become the tools of a new graphic artist—you.

The soft-focus technique has long been used to soften hard edges between shadows and light, allowing a foreground image to fade into the background. This is especially true for studio portraits, where backgrounds are often just painted canvas. Blending foreground and background can pull the eye toward the foreground, if done correctly.

In photography, the soft-focus effect originated as a result of flaws in camera lenses. Later, with the use of lens filters, the effect was often incorporated into glamour images because it smooths skin wrinkles. In the digital age, soft focus is a handy trick that can remove blemishes while adding charm to any image.

Fortunately for digital photographers, soft focus is a technique that raster-based programs like GIMP now provide, using common processes such as blurring. But it is also an effect that can be easily overused.

This tutorial will show you how to soften the focus of a studio portrait. Techniques like this require only modest experience with selections combined with colors tools and the Gaussian Blur filter.

This next technique is for all the would-be artists among us. What you can’t do with a pen and pencil, you can now do with a camera and GIMP. Although an inkjet print on textured paper isn’t quite the same as a fine hand-drawn sketch, it’s close enough for the digital crowd.

Converting a photo to a sketch basically means detecting the edges in an image and applying a slightly irregular line, one that looks like it might have been drawn by hand. This process isn’t exact—you might substitute a different edge-detect filter or use the Curves or Levels tools to adjust the desaturated layers before applying filters. But these basic steps will get you started.

  1. First, desaturate the image (ColorsDesaturate).

  2. Duplicate the layer twice (LayerDuplicate Layer). Name the first duplicate Burn and the second duplicate Hard Light.

  3. Turn off the visibility of the two duplicate layers by clicking the eye icon for each one in the Layers dialog. Then select the Background layer again.

  4. Open the Sobel filter (FiltersEdge DetectSobel). The Sobel filter is an edge-detect filter that looks for nearly horizontal and vertical lines in the layer and keeps those in the resulting image.

  5. Keep the default settings and click OK to apply them to the Original Image layer. The default settings for this filter, as opposed to the other edge-detect filters available in GIMP, will work best with this image because they’ll produce more solid and distinct lines that appear hand-drawn. However, you may get better results using another edge-detect filter if your image doesn’t look right after applying the Sobel filter.

  6. The white lines may need to be enhanced. Use the Levels dialog (ColorsLevels) and pull the White Point slider to the left.

  7. Invert the colors (ColorsInvert) for this layer to produce black lines on a white background.

Antique photos come in two flavors: black and white or tinted. Coloring black-and-white photos is easy with GIMP: you simply choose a color, pick a layer mode, and apply a Bucket Fill. There’s nothing to it. The tricky part is making it look right—adjusting the contrast in the grayscale image appropriately and then choosing the right layer mode.

Most people associate tinted pictures, rather than plain black-and-white ones, with antique photos. This may be because more old sepia-toned photos have survived. The processing chemistry for sepia prints converts the silver metal, which forms the image in black-and-white prints, into silver sulfide. Silver sulfide is more stable than silver metal. Thus, converting the silver to sulfide gives the photographs a much longer shelf life.

Sepia prints get their name from the range of brown tints produced by the development process, which resemble the ink of the cuttlefish (sepia in Latin). Re-creating true sepia tones digitally therefore limits us to a small set of dark brown colors, some with a slight tint of red. Similar processes could be applied using colors other than shades of brown, though the resulting images would not mimic true sepia prints.

In this tutorial you’ll try out some possible variations as you produce sepia-toned images using different combinations of colors, contrast, and layer modes.

This tutorial’s original image comes from an online image archive (available from BigStockPhoto.com) and has been desaturated using the Channel Mixer (Colors▸Components▸Channel Mixer). Alternatives to using the Channel Mixer dialog are using the Desaturate dialog or converting the image to grayscale (Image▸Mode▸Grayscale) and then back to RGB (Image▸Mode▸RGB). The primary difference between these latter two methods is that the Desaturate dialog only works on the current layer. If your image has more than one layer, the Desaturate dialog won’t convert all of those layers at once. For multiple layers, it would be more appropriate to convert the image to grayscale and then back to RGB.

But the Channel Mixer is the best option for this tutorial. Old photographs often owe their appearance to the use of orthochromatic film. Orthochromatic emulsions cause blue tints to appear brighter and reds darker. The Channel Mixer provides a higher degree of control in setting these channels when converting from color to a monochromatic image.

Since the original image is very crisp, and most old photos are not, a slight blur is applied next.

Sepia toning works primarily by colorizing the gray region of the desaturated image. Dark pixels are relatively unaffected, and lighter pixels just get a bit lighter. The locomotive in the image is very dark, so we’ll lighten it using the Levels tool to maximize the sepia tone’s effects.

Photographers are often asked to change the color of one or more elements in an image. How easy this process is depends entirely on how easy it is to isolate the objects that need updating.

This tutorial looks at two examples of color swap. The first is an image in which the color change doesn’t require difficult selections. The second image requires a more delicate hand.

The first example is a collection of boats on a beach. There’s a plethora of color here. Let’s change the yellow trim on some of these boats to a light blue.

The same trick doesn’t work on the next image. Let’s say you want to change the color of the vase to a shade of yellow. The problem is that although the vase’s reddish-brown color contains a lot of red, red also appears throughout the rest of the image. In fact, if you made the same change to this image’s red channel as you did to the boat image’s yellow channel, you’d change the color of the background chair, the berries, and the table.

You learned in 1.4 Selections that using the Quick Mask is the most effective way to select oddly shaped objects. Here’s a chance to try it out.

  1. Zoom in on the vase by pressing the + key.

  2. Draw straight lines in the Quick Mask with the Paintbrush tool’s small, hard-edged brushes by clicking at one endpoint of the line, holding down the SHIFT key, and then clicking at the other end of the line. When painting (or drawing) with the Quick Mask, you must paint with black or white. Set the foreground color to white to paint over what should be included in the selection, and set the foreground color to black to paint over what shouldn’t be in the selection. When you’re finished, click the Quick Mask button again to convert the mask to a selection.

  3. Grow the selection by 1 pixel (SelectGrow), and then feather it by 2 pixels (SelectFeather). Save the selection to a channel (SelectSave to Channel) in case you later decide to undo your color change and edit the selection again.

Take a look at any of your personal photos. If you’ve used a consumer-grade camera, you’ll notice that the photo has a deep depth of field. That is, if your subject is more than a few yards away, most of the photo is in focus. Changing the depth of field can alter the feeling an image conveys. If your intended subject is not centered in the frame or not completely obvious, a depth-of-field change can draw attention to the subject and expose the true meaning of the photo.

Making the depth of field shallow can also make a normal scene appear as if it was a miniature, as you’ll see in 2.11 Miniaturizing a Scene.

In reality, computer-aided depth-of-field trickery is no more than a selective blur. You’ve probably seen this trick used in automobile advertisements, where the car is in focus but the background is blurred beyond recognition. In this tutorial you’ll pull a building to the forefront of a photo using modest depth-of-field changes.

The original image is in focus and has an obvious foreground object—the outhouse. Start by creating a selection that includes the outhouse and some of the grasses in front of it. Here the unselected areas are tinted red to better show the selection.

  1. Choose the Fuzzy Select tool from the Toolbox. Click the blue sky to create an initial selection. If one click doesn’t select the entire sky, click somewhere in the unselected area while holding down the SHIFT key.

  2. Invert the selection (SelectInvert), and then click the Quick Mask button. As you’ve seen, unselected areas are tinted red when the default Quick Mask properties are in use (2.4 Color Swap showed you how to change the default color).

  3. Select the Paintbrush tool and press D in the image window to reset the default foreground and background colors, making the foreground black.

  4. Paint over the house on the left, some of the background grasses, and the rocky hill on the right. Use smaller brushes until the Quick Mask looks similar to that shown. Everything you paint over will be excluded from the selection.

  5. Click the Quick Mask button again to convert the mask back into a selection.

  6. Save the selection to a channel (SelectSave to Channel). Then click the channel name in the Channels dialog and change the name to Outhouse Selection. Saving selections to a channel allows you to easily recall them for further editing should you decide the original selection wasn’t sufficient for your project. Later in this tutorial you’ll retrieve the saved selections and invert them for use with areas outside the original selection.

  7. Select the original layer in the Layers dialog (WindowsDockable DialogsLayers). Feather the selection by 10 pixels (SelectFeather), and then copy (EditCopy) the selection and paste it (EditPaste) as a new layer (LayerTo New Layer).

  8. Click the new layer name and change it to Outhouse.

  9. In the Channels dialog (WindowsDockable DialogsChannels), click the Outhouse Selection channel, and then click the Channel to Selection button.

  10. Select the Background layer in the Layers dialog to make that layer active. Invert the selection to select everything except the original outhouse and foreground landscape.

  11. Click Select by Color in the toolbox. Adjust the Threshold level in the Tool Options dialog as necessary (I set it to 50 for this image).

  12. Hold down the CTRL key and click in the blue sky to remove the sky from the selection, leaving just the background grasses, the house, and the hill. Use Quick Mask to remove the house and hill from the selection, leaving some of the grasses. Click the Quick Mask button once more to convert the mask to a selection. Save the selection to a channel named Grasses Selection (SelectSave to Channel).

  13. Select the Background layer to make it active again. Feather the selection by 10 pixels (SelectFeather), and then copy and paste the selection as a new layer. Name this layer Grasses and move it below the Outhouse layer in the Layers dialog. The layer order should be, top to bottom: Outhouse, Grasses, Background.

  14. This process has created a secondary focal point that is not in the foreground but not completely in the background.

Simulating the reflection of an object on a glassy surface is actually pretty simple. In this example I’ll use a yellow rose. The vertical orientation of the rose—stem to flower—will make the reflection easier to see.

Because the rose would block any light shining directly overhead, you must add a shadow to the surface. And because light would shine in multiple directions above the rose, more than one shadow would be cast. Next you’ll create these shadows.

  1. Add a transparent layer named Shadow 1.

  2. Choose the Ellipse Select tool from the toolbox and create an oval selection just below the rose.

  3. Feather the selection by 10 pixels (SelectFeather) and fill it with black. Deselect the oval (SelectNone).

  4. Open the Gaussian Blur filter (FiltersBlurGaussian Blur) and apply a blur of 45 pixels to the Shadow 1 layer, and then set the layer’s Opacity to 65 percent. Move this layer to just above the Rose Reflection layer.

  5. Duplicate the Rose layer, name the duplicate layer Shadow 2, and increase the layer boundary size by 10 percent (LayerLayer Boundary Size).

  6. Create a selection of the rose (LayerTransparencyAlpha to Selection), and then grow the selection by 2 pixels (SelectGrow).

  7. Press D in the canvas to reset the foreground color to black. Then fill the selection with black by dragging the foreground color box from the toolbox into the selection. Deselect all (CTRL-SHIFT-A).

  8. Open the Gaussian Blur filter and apply a blur of 45 pixels to the Shadow 2 layer.

  9. Use the Flip tool to flip the layer vertically, and then use the Scale tool to reduce the height of the layer by half.

  10. Move the Shadow 2 layer beneath the Rose layer (LayerStackLower Layer), and then position it using the Move tool so the shadow appears below the yellow rose.

  11. Reduce the Opacity of the Shadow 2 layer to 35 percent.

The previous tutorial showed you how to create reflections on glass, but much more can be done by expanding on the technique. That section’s tutorial made only slight modifications to the object being reflected (a rose). But what about adding texture to the reflective surface? How can we create a reflection on a surface—like water—that isn’t perfectly flat?

An easy way to add surface texture is to grab it from another image. A photo that shows the surface of a lake or ocean will work well for this tutorial. Once the sampled image is desaturated and blended with the reflection, it turns a glassy surface into a realistic reflection.

This tutorial turns a lawn into an undulating lake. In the real world, creating exactly the image you want usually requires the application of more than one effect, so let’s start by enhancing the colors in the original photo.

Photo restoration and retouching—the art of preserving and enhancing old photographs folded from misuse or cracked and faded with age—is a form of digital image manipulation that is often overlooked. As you’ll see in this tutorial, GIMP’s tools enable you to achieve high-quality photo restoration.

A number of tricks can be used to restore damaged photos, but the most common technique involves cloning similar areas to use in replacing damaged areas. GIMP’s Clone tool allows you to use brushstrokes of any shape on copied and pasted areas. However, this method is only appropriate for minor cleanup work such as removing specks of dust or hiding thin, short scratches. Cloning is also destructive because it occurs in the layer where the damage exists. If the patches are not to your liking, you may not be able to reverse them easily.

A better strategy for correcting larger blemishes is to make a selection, copy and paste the selection as a patch layer, and then blend this into the original layer using the Airbrush tool in a layer mask. This approach has the advantage of allowing additional changes to be made later, by either modifying the layer mask or replacing the patch layer completely. Of course, no matter which approach you take, you’ll want to preserve your original damaged art for experimentation. In this tutorial, we’ll look at the copy-and-paste method of fixing heavily damaged images. We’ll also discuss when to use large selections to patch large areas and when to divide a blemish into pieces and patch them individually.

The big scratch across the woman’s sweater is an example of the kind of damage you can fix with a simple copy-and-paste correction that consists of a single patch. There is enough undamaged sweater in the photo to allow us to use this technique.

  1. Choose the Free Select tool and draw an outline around part of the scratch that traverses the woman’s midsection, and then press ENTER to convert this to a selection. This will give you the size of the area that must be patched. Choose the Move tool from the Toolbox. In the Tool Options dialog, click on the Selection option for the Move setting.

  2. Click inside the selection and drag the mouse to move the selection to an unblemished area near the scratch.

  3. Feather the selection by 10 pixels (SelectionFeather).

  4. Copy the selection and paste it in a new layer (LayerTo New Layer), and then position the new layer over the scratch. In this case, the sweater’s pleats help us align the patch, but your images will probably provide similar guides. (To show where the patch has been applied, the original image is tinted red.)

  5. In this example, the pleats don’t align perfectly, but this can be fixed by using the Scale tool or the IWarp filter (FiltersDistortsIWarp) to make minor adjustments. If the patch doesn’t align along its edges with the original layer, add a layer mask (LayerAdd Layer Mask) and use the Airbrush tool to spray black in the mask along the edges of the patch.

  6. If the patch’s tonal qualities don’t match those of the damaged area, you can use the Curves tool (ColorsCurves). Make sure the patch layer (not its mask) is active by clicking the layer preview in the Layers dialog. To see if the patch lines up well with the original image, turn the layer visibility for the patch on and off quickly (using the eye icon in the Layers dialog). As you do this, it should appear that the pleats (or other guides) are in place and only the scratch is removed.

Scratches on a subject’s face are more difficult to fix than those on clothing. It’s easier to spot differences between the patch and the surrounding face than it is to spot those between the sweater and its patches. Even so, facial scratches are best handled by using the Free Select tool, as we’ve done so far. The main difference is that you must make even smaller selections, bounded by high-contrast lines. Areas between the face and the hairline or between the bridge of the nose and the shadowed sides of the nose work especially well. The woman’s eye poses a particular challenge because that part of the image is so complex.

When you use the Clone tool, the length and direction of the line between the clone source and the initial clone destination (where you first click when you start to clone the image) always remains uniform. When you drag a line over the scratch, that same line is cloned, positioned to start at the clone source location. This means that if you drag far enough from the initial clone destination, you can cause the clone source to fall over another blemish. The trick is to keep your brush strokes small and reset your clone source point frequently.

It’s also possible to clone from another layer. In the Tool Options dialog, check the Sample Merged option. With this option you can clone from any layer that is being used to display the composite image.

Cleaning up the background is a no-brainer.

All the other large blemishes can be fixed with the same processes used for the sweater and face. In this case, the final results are dramatic. When the original image is scanned at a high resolution, an image restored using GIMP’s tools should produce a high-quality print. The results won’t always be so dramatic, but with practice some people are able to make a living doing this kind of work.

Adding a light source to a photograph can increase the photograph’s dramatic impact—especially when the light is shining through a paned window. But setting up a shot like the one shown here can be time consuming and usually requires a specific location. It would be easier if we could use software to add the light source to any image.

Fortunately, GIMP allows us to merge multiple shots to achieve this effect. Start with any stock photograph and use an image of a window as a stencil for the shadow. The process is so simple, you’ll probably have more trouble finding suitable stock images than you will producing the effect in GIMP.

Start by opening up a source image and an image to use as the shadow mask, both from their respective stock image files. If only a portion of the shadow mask image is intended to cover the source image, make a selection around that part of the shadow mask image and paste it into the source image as a new layer. This example doesn’t require a selection, because we want to use the entire shadow mask image, so we can just copy and paste it into a new layer in the source image.

  1. Copy the shadow mask image (EditCopy) and paste (EditPaste) it into the source image as a new layer (LayerTo New Layer) as shown here.

  2. Reduce the Opacity of the Shadow Mask layer to 65 percent, and then use the Move tool to position the window over the subject. The Shadow Mask was also scaled taller and wider with the Scale tool so only a single crosshair in the window is visible.

  3. To make the window look more like a shadow, you’ll need to desaturate and blur it. Desaturate the Shadow Mask layer (ColorsDesaturate), and then open the Gaussian Blur filter (FiltersBlurGaussian Blur). The Blur Radius should be set according to the image size. In this example, the Source Image is 2794 pixels wide, so the Blur Radius is set to 90 pixels. That gives roughly a 32:1 ratio, though you may find that a smaller ratio is more appropriate for smaller images.

  4. Expand the Shadow Mask layer to fit the full image (LayerLayer to Image Size). Make sure the Lock Alpha Channel box in the Layers dialog is not set.

  5. Using the Fuzzy Select tool, click the transparent regions of the layer to the left and right of the window image. This may require multiple clicks with the SHIFT key held down.

  6. Grow the selection (SelectGrow) by 20 to 50 pixels.

  7. With the canvas selected, press D to reset the foreground and background colors. Then drag the foreground color (black) into the selection to extend the shadow cast by the wall in which the window is set. If any lighter color lines are still visible along the edges of the selections, undo the drag (CTRL-Z) and grow the selection some more, and then drag from the foreground color again.

  8. Deselect all (SelectNone).

  9. Set the Shadow Mask layer mode to Multiply. In this example, the result is good, but more contrast would help. Use the Fuzzy Select tool and click in the darker areas of the Shadow Mask. Invert this selection (SelectInvert) to select just the windowpanes. Shrink (SelectShrink) the selection a bit.

Lighting alters the mood of an image. So far you’ve added lighting to a project by casting light through an unseen window. Now you’ll combine that idea with artificial effects. This project will add flowing streaks of light to a stock photo. These will dramatically change the mood with only a modest amount of work.

There isn’t a great trick to this process; getting the best results is mostly a matter of trial and error. The process starts with a little understanding of how to create and stroke paths. Paths are distinct from image layers. This allows paths to be edited without affecting the composite image and to be applied multiple times to any number of image layers.

The process starts with a stock photograph that’s dark enough that a streak of light will be a noticeable change. Creating an initial streak is a straightforward process with minimal edits of a single path.

An often underappreciated feature of GIMP is the blur filters. A small amount of blur can be used to soften the focus in a photograph, as was shown in 2.1 Soft Focus. 2.5 Changing Depth of Field demonstrated how varying amounts of blur can be used to move the background away from the foreground. And long blurs can apply streaks to an image that simulate high-speed flight.

This tutorial will use blurs to take the very big and make it appear very small. Even better, the process is very simple. This is yet another effect that gives a photo a shallow depth of field. Traditional photographers can achieve this effect with a technique called tilt-shifting. We’ll get similar results without the fancy equipment.

The best images for this effect are bird’s-eye views of a city. This particular image is perfect because the focal point of the effect is centered and easy to isolate. Also, miniatures often have highly saturated colors from hand painting with glossy paints. This process will increase the saturation of the stock photo, and then isolate areas outside the focal point of the image.

Now that you’ve practiced the basic techniques for working with photographs in GIMP, you’re probably eager to get started on your own photo projects. When you do, keep the following suggestions in mind.

Learn to love ’em (and make them effectively, as described in 1.4 Selections). When you’re working with photographs, you can’t do much without them.