☰ Contents · Computing

Other ways to select part of an image

Lessons 7 · 1 lessons · N. I. Taylaqov (general editor), A. B. Akhmedov, M. D. Pardayeva, A. A. Abdug‘aniyev, U. M. Mirsanov. Informatics and Information Technologies, Grade 11, 1st edition. “Extremum-press”, Tashkent, 2018
7

Other ways to select part of an image

Textbook: pp. 28–30
GoalSelects a complex part or a background with the magnetic lasso, magic wand and quick selection tools, explains the Tolerance setting and inverts a selection.
New words
Magnetic Lasso: a lasso whose line “sticks” to a sharp edge and sets anchor points by itself · Magnetic LassoMagic Wand: selects all neighbouring pixels whose colour is close to the colour of the clicked pixel · Magic WandTolerance: how far (0–255) a pixel's colour may differ from the clicked colour and still be selected · Toleranceinvert (Select → Inverse): swaps the selected and unselected parts · inversiya
Explanation

The Magnetic Lasso is the third tool in the Lasso group; it sticks like a magnet to the edge of an object that stands out sharply from the background. We click one point of the edge and move the mouse along it: anchor points appear on the line by themselves, a wrong point is removed with Backspace, in unclear places a point can be forced by clicking, and returning to the start and double-clicking closes the selection. The Magic Wand (key W) selects all pixels around the clicked pixel whose colour is close to it; the closeness is set by the Tolerance value on the options bar (0 to 255): when it grows, more colours are selected. A uniform background is very easy to select, but the background in a real photo consists of nearby colours, so instead of raising Tolerance too much it is better to hold Shift and click several places of the background one after another. Quick Selection is like the magic wand, but the area is grown step by step by dragging like a brush; newer versions also have Select → Subject and Object Selection, which find the object automatically. If you selected the background rather than the object, Select → Inverse (Ctrl+Shift+I) swaps the selection.

Worked examples
A picture of a bird against a plain blue sky. We press W to choose the Magic Wand (Tolerance 30) and click the sky; we add the leftover places beside the cloud with Shift-clicks. Then Ctrl+Shift+I inverts the selection: now the bird is selected and can be copied to another picture with Ctrl+C and Ctrl+V.
How Tolerance works: if the clicked pixel's colour is RGB (200, 120, 40) and Tolerance = 30, pixels whose every channel lies within ±30 are selected: R 170–230, G 90–150, B 10–70. The pixel (210, 130, 50) is selected, while (240, 130, 50) is not, because 240 > 230.
Class activity

“Remove the background”: each pair tries two methods (magic wand and magnetic lasso) on the same picture and writes in a table which was faster and which was more accurate.

Practice
1
Which tool suits an object with a sharp edge, and which suits a plain-coloured background?
2
The clicked pixel is RGB (150, 60, 220) and Tolerance = 25. Within which range must the red (R) channel lie for a pixel to be selected?
3
In what order are the steps done to select the object itself in a picture with a plain background?
4
Why is it better to Shift-click several places of the background than to make Tolerance very large?