Modifying Selections

See the introductory Selections topic for an introduction to selection in general and for a tutorial on basic selection methods that apply to all components.


This topic discusses a selection feature that is unique to images and surfaces. Certain selection functions make sense in images and surfaces but have no equivalent in other components. Such selection functions depend upon the component consisting of a continuous sea of pixels. In particular, when selecting pixels in images we often can refer to the selection as a region of particular shape. It is often highly desirable to be able to modify the shape of the region of selected pixels. We can do this with the Modify Selections commands or by Selection using Masks .


This topic uses images as examples. However, the techniques used apply to surfaces as well. Note that compressed images do not support selection.


Modify Selections


Selection modification commands are very useful when preparing images for use in vectorizing. In addition to general-purpose selection in images, they may be used to create "buffer zones" within images and other sorts of pseudo-analytical selections.


The Edit - Modify Selection menu provides four choices for modifying the shapes of regions of pixels that have been selected:



Take the current region of selection and convert it to region of selected pixels that are +/- the given width of pixels from the boundary of the current region.


Shrink the region of selected pixels by the given number of pixels.


Expand the region of selected pixels by the given number of pixels.


Create a smoother periphery of the selected region using the given parameters.


The Smooth function uses Threshold and Passes parameters. Each pixel on the edge of the selected region is evaluated by looking at its eight immediate neighbor pixels. If enough of the neighboring pixels are selected, then the central pixel will be selected. The threshold, a value from 1 to 4, states how many of the neighboring pixels must be selected before the central pixel is selected. The passes parameter states how many times this iterative process should be applied. The more it is applied, the smoother the periphery of the region of selected pixels will be.


images\img_sel_smooth01.gif images\img_sel_smooth02.gif


Select touch was used in the image above to click on the sky. To eliminate the ragged edge of pixels at the periphery of the selection, we used Edit - Modify Selection - Smooth with the parameters shown below.




By increasing the number of passes we can make the periphery smoother as well as reduce the number of small "islands" of unselected pixels within the main body of the selection.


The selection modification commands are very useful when preparing images for use in vectorizing.


Example: Using Modify Selection - Expand to create a Buffer Zone


A "buffer zone" is simply a region that extends a certain distance beyond another region. For example, we might which to mark all pixels near the shoreline in an aerial photograph of waterfront development.


In this example we create a buffer zone of selected pixels that outline the upper part of the monument in our "bronze" sample image:




Step 1: Select an upper region - We do this by a combination of touch selection, Edit - Modify Selection - Smooth and then using select rectangle to subtract the lower region to leave a nice, smooth lower border. We use the Edit - Selections dialog to save this as a saved selection called "sky"




Step 2: Select the inverse region - Using Edit - Select Inverse to select the inverse region and then select rectangle with the mouse with Subtract from Selection mode to remove the bottom pixels. This leaves just the region in the upper part of the monument.




Step 3: Expand the selected region - Using Edit - Modify Selection - Expand we expand the region of selected pixels by 5 pixels.




This results in a region of selected pixels that extends outwards from the upper part of the monument.




Step 4: Use Intersect Selection Command from Selections Dialog - Within the View - Selections dialog we click on the sky saved selection. If the Preview button is checked, we will see a preview of the sky selection in blue. Note how it overlaps the expanded selection region created in the previous step.




images\btn_selcmd_int.gif Press the Intersect Selection command to intersect the sky selection with the expanded selected region. The selection now becomes the region of intersection, which is our desired buffer zone.


Using Modify Selection - Border


We can also create a buffer zone using Border selection modification. In this case, the "buffer zone" will extend both inward and outward from the edge of the previous selection region.




Suppose we start with a selection consisting of pixels in the upper part of the monument.




Using Edit - Modify Selections - Border with a setting of 5 pixels for the Width creates a zone of selected pixels extending both outward and inward from the previous periphery.




Border Width


The Width parameter is an approximate parameter in curved areas, since it is the number of pixel steps from the meandering line of pixels that is taken to be the center of the border region. The actual width of the border zone will be [width * 2 - 1] since the center line counts as one "width" amount.




Suppose we zoom into the image so we see the starting region of selected pixels at the head of the monument.




If we now run Border with a width of 1, a single line of pixels is selected at the periphery of the initial region. We can save this selection in the Selections dialog so that it may later be compared to other settings for width.




In the above illustration, instead of using a width of 1, we used a width of 3. We can see the previous setting of 1 in blue as a preview from the Selections dialog. Note how in vertical and horizontal areas where pixel stepping is clear we can see that the border region is five pixels wide because the "3" in the width parameter includes the center line pixel when counting out to either side. Thus, the border extends from the center pixel plus 2 pixels to either side.


Touch Selection Tolerance Setting


Touch selection will select all pixels whose color is within a given tolerance range of the pixel touched by the mouse. For RGB or RGBa images, tolerance is computed only on those channels that are made visible in the layers pane. For palette images, tolerance is computed based on the R, G and B values of the palette color as compared to other palette colors. Change the tolerance setting as desired in the Tool Properties pane to increase or restrict the range of pixel color values that are selected when using touch selection.


images\img_bronze_tolerance01.gif images\img_bronze_tolerance02.gif images\img_bronze_tolerance03.gif


In the illustrations above we have increased tolerance from a low level to a much higher level and then clicked on the blue sky just above the head of the monument. As tolerance is increased a greater number of pixels are selected in colors that are more and more different from the blue hue of the touched pixel. At high tolerance settings pixels with colors very different from the touched pixel will be selected.


Speed of Select Touch in Images


By default, touch selection finds all pixels of similar color that are in a region connected to the touched pixel. Using SHIFT-touch selection finds all pixels of similar color whether or not they are in a contiguously connected region to the touched region. Determining whether or not pixels are within a contiguously connect region requires many spatial computations, so SHIFT-touch selection frequently will operate much faster than touch selection.