Earlier you used RGB channels to isolate images with fuzzy, complex, or indefinable edges from their backgrounds. Another option is to use the Filter ’ Extract command for this purpose. The results might not be as precise as the channels method, but you can, by trial and error, isolate problem edges with much less effort. The Extract command is actually a mini-program, complete with a subinterface (see Figure 21.17), that measures subtle differences of the edge of an image by its color and brightness content and then determines how best to isolate the region.
Use the Edge Highlighter to define the image s edges; you then fill its interior and preview it. You can refine and preview as many times as you like until you have all of the image and none of the background. You then extract it, which deletes undefined areas and places the image on a transparent layer.
Note | Because of the radical transformation that Extract produces, you should first duplicate the image or make a snapshot of it. |
Specify the following tool options in the dialog panel:
Brush Size Enter a value or drag the slider to specify the width of the Edge Highlighter tool, which defines the boundary of the image.
Highlight Choose a color to display the edge boundary that you draw with the Edge Highlighter tool.
Fill Choose a color to display the interior fill inside the boundary.
Smart Highlighting This option helps you keep the highlight on the edge, especially when the edge between the foreground and background is sharp with similar color or texture. To toggle Smart Highlighting on or off while you drag, press the /Ctrl key.
To practice extracting an image, choose Filter ’ Extract and open the file iris.psd in the ch21 folder on the CD. Then follow these steps:
Set the Highlight color to red and the Fill color to blue.
Choose a 24 px Brush Size. Select the Edge Highlighter tool and drag along the edge of the flower to highlight the edge of the object you want to extract. Draw the highlight so that it slightly overlaps both the foreground and background regions around the edge, to cover areas where the foreground blends into the background.
Use a smaller brush to precisely highlight edges that are more defined, such as the area around the flower s base. Use a larger brush to highlight the fuzzy edges around the petals, loosely covering the soft transitions. Don t highlight the bottom or top of the flower, only the sides.
If you make a mistake, erase the highlight. Select the Eraser tool from the dialog box and drag over the highlight. This tool is available when a highlight exists. You can completely erase the highlight by pressing Alt-Backspace or Option-Delete.
Note | To toggle between the Highlighter and the Eraser while drawing an edge, press the Option or Alt key. |
To fill the flower, select the Fill tool . Click inside the outline to fill its interior (see Figure 21.18).
Figure 21.18: The highlighted and filled flower
Note | If the image is especially intricate or lacks a clear interior, make sure that the highlight covers the entire edge. To highlight the entire object, press Ctrl-Backspace (Win) or -Delete (Mac), and then select Force Foreground. Use this technique with areas that contain tones of a single color. |
Click Preview to view the extracted image. The edges of the flower will be soft, and the area around it will be transparent, like the one in Figure 21.19. You can better see the result of the extraction if you view it by using the following techniques:
In the Show menu, switch between previews of the original and extracted images.
Use the Display menu to preview the extracted object as a grayscale mask or against a white matte or a black matte. To choose a colored background, choose Other and a color from the Color Picker. To display a transparent background, choose None.
Select the Show Highlight or Show Fill option to display the object s extraction boundaries or interior.
Several tools enable you to alter the edges and interior of the extraction, adding areas to the extraction or eliminating unwanted pixels.
You can edit and refine the extraction with the Cleanup tool , which is available only when you preview the extracted image. The Cleanup tool subtracts opacity. If you make multiple passes , it will have a cumulative effect. Drag over an area to erase it to transparency. Press the Option/Alt key while painting with the Cleanup tool to restore opacity.
Note | The Eraser and Fill tools can also be used to edit the previewed image. The Eraser restores the edge to transparency. Clicking a filled area with the Fill paint bucket removes the fill. |
Use the Edge Touchup tool to edit the extraction boundaries. The tool, which is available when you show the extracted image, sharpens the edges of the extracted image. It has a cumulative effect as you make multiple passes over the edge. If there is no clear edge, the Edge Touchup tool adds opacity to the image or makes the background more transparent.
If the foreground or background of your image is textured, check the Textured Image box to better define the extraction.
To help remove stray artifacts in the extraction, click on the right arrow next to the Smooth field in the Extract dialog box. Enter a value in the field or drag the Smooth Slider. The higher the number, the greater the radius of pixels that will be affected. When you are finished editing, click Preview again to view the edited extraction. You can edit and preview the extraction as many times as you like until you achieve the results you want.
To apply the final extraction, click OK. All pixels on the layer outside the extracted image are eliminated. If necessary, use the History brush or the Background Eraser to touch up stray edge pixels and flawed areas.