The lasso (or "free form selection") is an editing tool available, with minor variations, in most digital
image editing software
In computer graphics, graphics software refers to a program or collection of programs that enable a person to manipulate images or models visually on a computer.
Computer graphics can be classified into two distinct categories: raster graphics a ...
. It is often accessed from the standard main menu (in
Photoshop
Adobe Photoshop is a raster graphics editor developed and published by Adobe Inc. for Windows and macOS. It was originally created in 1988 by Thomas and John Knoll. Since then, the software has become the industry standard not only in raster ...
,
Paint Tool SAI, and
GIMP, as common examples), by clicking the icon of a dotted line shaped like a rope
lasso
A lasso ( or ), also called lariat, riata, or reata (all from Castilian, la reata 're-tied rope'), is a loop of rope designed as a restraint to be thrown around a target and tightened when pulled. It is a well-known tool of the Spanish an ...
, from which the common name arises.
Standard operation
The lasso tool operates on the active layer of an image, and is used by
clicking and dragging to trace the edges of a selection. Most software supports multiple closed contours, which can be selected by crossing over the edge path multiple times. It is also typically not necessary to close the shape: releasing the mouse button triggers the software to close any open loop(s) automatically. The area enclosed by the cursor path will remain selected and open to various transform operators (shift, scale, cut, copy, and paste, for example) until elsewhere in the image is clicked. At this point, the lassoed selection will merge with the layer it was selected from.
Characteristics
In contrast to other image selection algorithms such as intelligent scissors, magic wand, or
grabcut GrabCut is an image segmentation method based on graph cuts.
Starting with a user-specified bounding box around the object to be segmented, the algorithm estimates the color distribution of the target object and that of the background using a Ga ...
, lassoing places no requirements on the image, as the user is free to create any closed path.
Technical description
From an
image processing standpoint, the lasso is fundamentally a
masking tool. The edges of the mask are defined by user input: the path of the cursor while the button is held down. A temporary new active layer is created which contains the logical AND of the masking layer and the active image layer. Meanwhile, the original active layer is masked (logical AND) with the inverse of the lasso selection. This creates the impression that the tool has sliced out a piece of the original image for selective transforms and edits. Most operations available for a full image can now be applied to the temporary active layer.
When the layers are merged, pixels in the temporary active layer will replace the pixels in the active layer with which they coincide. "Empty" pixels are handled in one of two ways depending on whether or not the imaging software supports
alpha compositing
In computer graphics, alpha compositing or alpha blending is the process of combining one image with a background to create the appearance of partial or full transparency. It is often useful to render picture elements (pixels) in separate pas ...
. They may take on the value of a default "background" color, or they may continue to be defined as transparent with an alpha channel value of zero.
References
{{Reflist
Graphic design