The bounding rectangle of the entire selection. It can exceed the bounds of the canvas.
True if the selection itself is a rectangle with all fully selected pixels. Viewed as a channel, for example via Quick Mask Mode, the selection will appear as a completely white rectangle. In that way, it is solid within its bounds.
Contract (shrink) the selection by the specified amount.
If the contraction amount is greater than the selected area radius, the selected area will disappear entirely. If there are no other active selected areas, then there will be no active selection altogether.
UI Location: Select > Modify > Contract
The amount to contract the selection (integer in the range 1..500).
OptionalapplyEffectAtCanvasBounds: booleanBy default this is false, meaning that any part of the selection that touches the bounds of the canvas will not be affected by the contraction.
Cancel the current selection. The bounds value will then be null.
UI Location: Select > Deselect
Expand the selection outward by the specified number of pixels.
UI Location: Select > Modify > Expand
The amount to expand the selection (integer in the range 1..500).
OptionalapplyEffectAtCanvasBounds: booleanBy default this is false, meaning that any part of the selection that touches the bounds of the canvas will not be affected by the expansion.
Feather the edges of the selection by the specified amount. This softening
of the selection strength is best viewed as a channel via Quick Mask Mode.
Large values might make the selection disappear entirely (.bounds would return null).
UI Location: Select > Modify > Feather
The amount to feather the selection with (decimal in the range 0.1..1000).
OptionalapplyEffectAtCanvasBounds: booleanBy default this is false, meaning that any part of the selection that touches the bounds of the canvas will not be affected by the feathering.
Grow the selection to include all adjacent pixels falling within the specified tolerance range.
Unsupported modes: Bitmap, RGB 32 bits, Grayscale 32 bits
UI Location: Select > Grow
The tolerance range (integer in the range 0..255)
OptionalantiAlias: booleanWhether to use anti-aliasing (default: true)
Set the active selection to the inverse of the current selection.
The new active selection will be cropped to the canvas bounds.
If the canvas area is fully selected, inverse will result in no active selection.
Note also that Artboard bounds are not respected.
UI Location: Select > Inverse
Load the selection from the specified Channel or Layer. A Layer's pixels' transparency will be used as the selection values. Full opaque pixels yield fully selected pixels.
UI Locations:
For selecting a path please use PathItem.makeSelection
The Channel or Layer to load the selection from. Can be located in different document.
Optionalmode: SelectionTypeThe selection behavior when a selection already exists. Default: SelectionType.REPLACE
Optionalinvert: booleanTrue to invert the selection (default: false)
Create a work path from the active selection.
UI Location: Paths panel > Make work path icon
Optionaltolerance: numberThe tolerance (lower values, higher precision), decimal in the range 0.5..10 (default: 2)
Scale the selection itself in percent. Does not affect the active layer.
UI Location: Select > Transform Selection
Optionalhorizontal: numberThe amount to scale selection horizontally (decimal, default: 100)
Optionalvertical: numberThe amount to scale selection vertically (decimal, default: 100)
Optionalanchor: AnchorPositionThe anchor position to scale around. Default: AnchorPosition.MIDDLECENTER
Optionalinterpolation: InterpolationMethodThe resampling algorithm to use. Default: InterpolationMethod.BICUBIC
Rotate the selection itself clockwise around the given anchor position. Does not affect the active layer.
UI Location: Select > Transform Selection
Angle to rotate the selection by in degrees (decimal in the range -180..180)
Optionalanchor: AnchorPositionAnchor position to rotate around. Default: AnchorPosition.MIDDLECENTER
Optionalinterpolation: InterpolationMethodThe resampling algorithm to use. Default: InterpolationMethod.BICUBIC
Save the selection in a new Alpha Channel.
UI Location: Select > Save Selection...
OptionalchannelName: stringThe name of the new channel to create (Default: "Alpha 1", "Alpha 2", etc.)
Save the selection in an existing Alpha Channel (Component Channels are not supported targets).
The targeted Alpha channel for the save operation.
Optionalmode: SelectionTypeThe selection behavior when a selection already exists. Default: SelectionType.REPLACE
Select the entire canvas.
If the document has artboards, all the pixels of the artboard that contain the active layer will be selected.
If layers across multiple artboards are active, a single rectangular selection will be made, with bounds wrapping them.
If no artboard is active, all artboards will be selected in the same manner. (The resulting selection might be smaller than the canvas bounds.)
UI Location: Select > All
Create a new selection based on the border of the active selection. The new selection will be an area equivalent to a stroke of that border by the given width in pixels. The result is not limited by canvas bounds.
UI Location: Select > Modify > Border...
The width of the border selection (integer in the range 1..200)
Select a single column of pixels.
UI Location: Toolbar > Single Column Marquee Tool
The x coordinate in pixels of the column to select (integer). The range should be within the document width.
Optionalmode: SelectionTypeThe selection behavior when a selection already exists. Default: SelectionType.REPLACE
Make an elliptical selection.
UI Location: Toolbar > Elliptical Marquee Tool
The bounds of the selection, as an object with {top, left, bottom, right} properties.
Optionalmode: SelectionTypeThe selection behavior when a selection already exists. Default: SelectionType.REPLACE
Optionalfeather: numberThe amount of feathering in pixels to apply to the selection (decimal in the range 0..1000, default: 0)
OptionalantiAlias: booleanIf true, anti-aliasing is applied to the selection (default: true)
Make a polygonal selection.
UI Location: Toolbar > Polygonal Lasso Tool
The points to select as an array of objects with {x, y} properties.
Optionalmode: SelectionTypeThe selection behavior when a selection already exists. Default: SelectionType.REPLACE
Optionalfeather: numberThe amount of feathering in pixels to apply to the selection (decimal in the range 0..1000, default: 0)
OptionalantiAlias: booleanIf true, anti-aliasing is applied to the selection (default: true)
Make a rectangular selection.
UI Location: Toolbar > Rectangular Marquee Tool
The bounds of the selection, as an object with {top, left, bottom, right} properties.
Optionalmode: SelectionTypeThe selection behavior when a selection already exists. Default: SelectionType.REPLACE
Optionalfeather: numberThe amount of feathering in pixels to apply to the selection (decimal in the range 0..1000, default: 0)
OptionalantiAlias: booleanIf true, anti-aliasing is applied to the selection (default: true)
Select a single row of pixels.
UI Location: Toolbar > Single Row Marquee Tool
The y coordinate in pixels of the row to select (integer). The range should be within the document height.
Optionalmode: SelectionTypeThe selection behavior when a selection already exists. Default: SelectionType.REPLACE
Reduce patchiness and smooth sharp corners and jagged lines in the selection. Smooth will also remove isolated groups of pixels that are smaller than the given radius. This effect is useful for cleaning up stray pixels from color-based selections.
Large values might make the selection disappear entirely (.bounds would return null).
UI Location: Select > Modify > Smooth...
The sample radius in pixels (integer in the range 1..500)
OptionalapplyEffectAtCanvasBounds: booleanBy default this is false, meaning that any part of the selection that touches the bounds of the canvas will not be affected by the smoothing.
Move the selection itself relative to its current position. Does not affect the active layer.
UI Location: Select > Transform Selection
The amount to move the selection horizontally (decimal).
The amount to move the selection vertically (decimal).
Represents a selected area or areas in the document. If there is no active selection, the
boundswill returnnull. The selection is pixel-based, though 8-bit transparency is possible.Pixel selection targets where pixel filters are applied, or from where the histogram measurement is sourced.
See
https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/selection/
Example
Pixel selection while in Quick Mask Mode: When a user switches into Quick Mask Mode, the selection is temporarily shown as a channel instead of the "marching ants" border. While in Quick Mask Mode, new pixel selections can be made via Scripting. However, upon exiting Quick Mask Mode, the Quick Mask Channel will become the active selection.
Min Version
25.0