Complementary to the selection tools are the 12 functions in the Image:Select menu. In addition to these functions, there are five other important functions related to selections. These are Toggle Selection, found in the Image:View menu, and Copy, Cut, Paste, and Stroke, found in the Image:Edit menu. Each of these functions is described in this section.
A selection partitions an image into two sets--the selected pixels and the unselected ones. It is often useful to invert a selection, which is just the swapping of these two sets. When inverting, the unselected pixels become selected pixels and vice versa. The command that does this is Invert from the Image:Select menu. The Invert function is used so often you'll want to remember the keyboard shortcut for it, which is C-i.
The function All in the Image:Select menu selects everything in an image. If the active layer in the image is smaller than the largest layer, the selection is clipped to the boundaries of the active layer. I personally don't find this to be a very useful command.
The function None in the Image:Select menu deselects everything in an image. This is very useful, as will be seen in the ensuing chapters. The keyboard shortcut for this command is C-S-a.
A selection can be made into a floating selection by choosing Float from the Image:Select menu. Floating selections were discussed in Section 2.5. A useful application of Float is described in Section 2.6.2.
Feathering was explained in Section 3.1.2. Normally a feather is applied by toggling on the Feather checkbox in the selection tool's Tool Options dialog before making the selection. However, it is possible to apply a feather after the selection has been made by choosing Feather from the Image:Select menu.
The concept of a partially selected pixel was introduced in Section 3.1.2, in the discussion on antialiasing, and was extended in Section 3.1.2, in the discussion on feathering. The function Sharpen, from the Image:Select menu, removes partially selected pixels in an image by transforming those that are 50% or more selected into fully selected pixels and by fully deselecting all the remaining pixels. Thus, this function sharpens the active selection (not the image).
It is sometimes useful to be able to shrink a selection a little. If a selection has been made with a tool like the Magic Wand or with the By Color selection function, it is possible that the resulting selection is a little too large. The Shrink function, found in the Image:Select menu, shrinks the boundary of the current selection by the amount specified in its dialog. The default unit is 1 pixel, but other values can be chosen.
In contrast to Shrink, the function Grow, from the Image:Select menu, grows the boundary of the current selection by the amount specified in its dialog. The default unit is 1 pixel.
The Border command, found in the Image:Select menu, replaces a selection with just those pixels within a specified radius of the selection edge. Thus, this function creates a selection of the border around the previous selection's edge. This command is a combination of the two functions Shrink and Grow. In particular, if A represents the set of selected pixels obtained by applying Grow to a selection and B represents the set obtained by applying Shrink, Border produces the set that could otherwise be obtained by doing A-B (see Section 3.2 for more on combining selections). The width of the border is specified by the border dialog.
Border is particularly useful for refining selection edges. An example of using Border is presented in Section 7.4.
Channels were introduced in Section 2.2. As will be discussed in greater detail in Section 4.1, channels can be used to store selections. This is an extremely useful feature of the GIMP because it allows you to save your selections, to reuse them in the current image or in others, and to edit them with the masking utilities (more on this in Chapter 4). The operation of saving a selection to a channel is performed with the Save to Channel function, found in the Image:Select menu.
It can be seen in Figure 3.17(b) that, other than the usual Red, Green, and Blue channels usually found in the Channels dialog, there is a channel named Selection Mask Copy. This channel shows a thumbnail of the mask representing the selection. Much more on the subject of masks and selections is discussed in Chapter 4. This is a very powerful feature of the GIMP. Check it out!
The By Color selection tool, found in the Image:Select menu, is similar to the Magic Wand in that it automatically selects pixels in the active layer that are close in color to a seed pixel value. The difference, however, is that the selected pixels are not obtained by growing a contiguous region around the seed. The By Color selection tool selects all the pixels in the layer that are within a specified threshold of the seed pixel's color. This is a subtle but important difference. It means that if two regions of similar pixel colors are separated by one of very different values, the By Color selection tool will get both regions, and the Magic Wand will not.
Choosing By Color brings up the dialog pictured in
Clicking in the image window produces a black and white mask in the thumbnail area of Figure 3.18(a). This mask corresponds to a selection in the image window, as can be seen in Figure 3.18(b). The selection can be removed by clicking on the Reset button in the By Color Selection dialog.
When the dialog's Replace radio button is selected, clicking a second time in the image window replaces the selection that was there with one based on the new seed pixel's color. The three other radio buttons in the dialog can be used to add, subtract, or intersect the selection created with the By Color function with an existing selection in the image window. Adding, subtracting, and intersecting selections was explained in Section 3.2.
Selections can be converted to Bezier paths. As was described in Section 3.1.1, Bezier paths are extremely useful tools because they allow selections to be interactively modified. The To Path function, found in the Image:Select menu, converts a selection to a Bezier path by automatically finding the control points and the control handle settings to re-create the selection.
Note that clicking inside a path to convert it to a selection might not toggle off the path's visibility. If this happens, the path can be toggled off by clicking on any icon (other than the Bezier Path's) in the Toolbox. Much more on Bezier paths is covered in Section 3.4.
Unlike the other selection functions discussed in this section, Toggle Selection is found in the Image:View menu. This command is very useful when trying to carefully position layers or selections (for examples, see any project in Chapter 7), or when trying to color-match a layer or selection edge (for an example, see Section 7.5).
The Toggle Selection command toggles on and off the visibility of a selection's Marching Ants. However, this function does not eliminate the selection. The selection is still there, it is just not visible in the image window. The Toggle Selection feature also toggles on and off the visibility of the black-and-yellow layer boundaries in an image. This feature is also used extensively in Chapter 7.
There is a pitfall when using Toggle Selection. It is easy to forget that selection boundaries have been toggled off. This can lead to confusion, especially when a subsequent selection is made. Because selection visibility has been toggled off, the Marching Ants do not appear. I've scratched my head many times, trying to figure out why all of a sudden the GIMP no longer seemed to be working! The GIMP, of course, was working just fine. The selection is there; it just can't be seen until its visibility is toggled back on.
The Toggle Selection function is so useful that you might want to memorize its keyboard shortcut, which is C-t.
Copy, Cut, and Paste are probably the most frequent operations performed on selections. These three functions are found in the Image:Edit menu. However, they are used so frequently that it would be worth your while to memorize their keyboard shortcuts. The keyboard shortcut for Copy is C-c, Cut is C-x, and Paste is C-v. More on these functions can be found in Section 2.4.
The Stroke function is found in the Image:Edit menu. This command paints a selection edge's outline with
the active foreground color using the active brush.