Selection in Images

This example topic shows use of selections in an image, using the globe.jpg sample image from the Manifold Release CD. We will use saved selections and selection commands to select only South America. We then apply visual effects only to the land area of South America.

 

Step 1: Create a new project

 

Use File - New to create a new project.

 

Step 2: Import the globe.jpg image

 

Use File - Import - Image to import the globe.jpg image into the project.

 

Step 3: Open the image in an image window

 

images\eg_select_image_01.gif

Double-click on the image in project view to open it. The system will display an info bar warning that the projection of the image has not been verified. In this example, we are not concerned with the projection of the image, so click the info bar to launch the Assign Projection dialog and click OK in the dialog to confirm that the projection is OK.

 

Step 4: Increase contrast

 

images\eg_select_image_02a.gif

We will increase the contrast in the image to make it easier to "touch select" the pixels representing the ocean. Do this By choosing Image - Adjust - Brightness / Contrast and entering a value of 40 for the Contrast. Enter the "40" value either by moving the slider bar or by clicking into the number box and entering 40 from the keyboard. Click OK.

 

images\eg_select_image_02.gif

The result is an image with brighter light tones and darker dark tones.

 

Step 5: Open the saved selections pane

 

We will be saving some of the selections we make. Open the saved selections pane by choosing View - Panes - Selections or by pressing the SHIFT-ALT-S keyboard shortcut. Drag the saved selections pane to a convenient place on screen where it does not cover South America.

 

Step 6: Select oceanic pixels

 

images\eg_select_image_03a.gif

Using Select Touch in Replace Selection mode, SHIFT - click anywhere on an ocean to select all pixels in the ocean, as well as all other pixels with this color. The SHIFT click is an instruction to select all pixels of the touched color, including those pixels not contiguously connected to the touched pixel. This command is necessary because at the resolution of this image there is not a continuous run of pixels between the Red Sea, Black Sea and other oceanic areas. Therefore, simply clicking on an ocean area will not also select the isolated pixels. Using a SHIFT - click will select the isolated pixels as well.

 

images\eg_select_image_03.gif

The result is that all pixels in oceanic regions are selected.

 

Note: Using SHIFT - click to select all of the oceanic areas at once depends on the color used for oceanic pixels being unique. If the same shade of blue also appeared within continental areas we could not take this approach. Instead, we would use Add to Selection mode and then with Select Touch we would click the main ocean region, the Black Sea, the Red Sea and so on to build up the selection by clicking each contiguous region of pixels having the color we wish to select.

 

Step 7: Save oceanic selection

 

images\btn_add_thing.gif In the saved selections pane, click the New Selection button to add this selection to the saved selections.

 

Step 8: Change the saved selection's name to "Oceans"

 

images\eg_select_image_03b.gif

In the saved selections pane, double-click into the "Saved Selection" name and change it to "Oceans" and press Enter.

 

Step 9: Select overlapping circles to cover South America

 

images\btn_deselect.gif Clear the selection.

 

images\eg_select_image_04a.gif

With selection mode set to Add to Selection, use Select Circle on Center to select a circle that covers much of South America.

 

images\eg_select_image_04.gif

Repeatedly use Select Circle on Center to cover all of South America with overlapping circles.

 

images\eg_select_image_05.gif

We don't have to be very precise, since the next step will trim the selection. We can safely overlap ocean areas.

 

images\eg_select_image_06.gif

We only need to be sure that the circles do not overlap land areas (such as various islands) we do not wish to select as part of South America.

 

Step 10: Subtract the Oceans saved selection

 

images\eg_select_image_07a.gif

In the saved selections pane, click on the Oceans saved selection and then press the Subtract from Selection command button. The pixels in the Oceans saved selection will be subtracted from the current selection created with overlapping circle selections.

 

images\eg_select_image_07.gif

The result is a selection that covers only the land area of South America.

 

Note: had we wished to see what effect subtracting the Oceans saved selection would have before pressing the Subtract from Selection button, we could have checked the Preview box in the saved selections pane. This would have previewed the Oceans selection in blue color when the Oceans selection was highlighted. This would let us see how it overlaps the existing selection. For examples of using Preview, see the Invisible Pixels and Selection and the Modifying Selections topics.

 

Step 11: Save the South America selection

 

Just in case we would like to later recall just the South America selection, we can save it in the saved selections pane. In the selections pane, click the new selection button to add this selection to the saved selections.

 

images\eg_select_image_07b.gif

Double-click into it to rename it to "South America."

 

Note: The selections pane can hold up to six saved selections for each image or surface with a seventh selection reserved for invisible pixels. Drawings and labels components can have seven saved selections.

 

Step 12: Alter only the South America selection

 

images\eg_select_image_08a.gif

We can pull down the Selection Style menu to choose a Border style of selection.

 

images\eg_select_image_08.gif

This outlines the selected region with a border line in red selection color so that the red selection pattern does not interfere with our view of the selected region.

 

images\eg_select_image_09a.gif

We can choose Image - Adjust - Hue / Saturation to alter the hue of the pixels in the selected region. Changing the hue to -90 will shift the colors towards greener hues. Press OK to apply the change.

 

images\eg_select_image_09.gif

The result is that South America is colored in green hues.

 

images\eg_select_image_10.gif

We can use the above techniques to alter the rest of the image as desired. For example, to create the image above we selected land areas in North America using overlapping circles, and then in the saved selections pane we used the Subtract from Selection command button to subtract the Oceans selection and to subtract the South America selection. We then changed the hue of the remaining North America selection. We also selected the Oceans selection again by clicking on the Oceans selection in the saved selections pane and choosing Replace Selection. We then reduced the brightness of the ocean regions to make these pixels black. Finally, we deselected everything and applied Image - Effects - Relief to give the continents and mountain ranges a 3D appearance.