Edit in GitHubLog an issue

Selection

Implements

Properties

bounds

bounds: Promise‹PsCommon.Bounds›

The selection's rectangular bounds


parent

parent: Promise‹Document

The document this selection belongs to


solid

solid: Promise‹boolean›

Whether the selection is solid

Methods

copy

copy(merge?: boolean): Promise‹void›

Invoke a copy command on the selection

Parameters:

NameTypeDescription
merge?
boolean
Copy merged contents of all visible layers

cut

cut(): Promise‹void›

Invoke a cut command on the selection


expand

expand(amount?: number): Promise‹void›

Expands the selection by a pixel amount

Parameters:

NameTypeDescription
amount?
number
Pixels to expand by

feather

feather(amount?: number): Promise‹void›

Feathers the selection by a pixel amount

Parameters:

NameTypeDescription
amount?
number
Pixels to feather by

invert

invert(): Promise‹void›

Invert the selection


nudge

nudge(horizontal: number | PercentValue | PixelValue, vertical: number | PercentValue | PixelValue): Promise‹void›

Implementation of Transformable

Moves the selected pixels.

Copied to your clipboard
// nudge the selection to the left by 200px
await selection.nudge(-200, 0)

Parameters:

NameTypeDescription
horizontal
number | PercentValue | PixelValue
Numeric value to offset selection content by in pixels
vertical
number | PercentValue | PixelValue
Numeric value to offset selection content by in pixels

perspectiveTransform

perspectiveTransform(percentH: number | PercentValue, percentV: number | PercentValue, interpolation?: InterpolationMethod): Promise‹void›

Implementation of Transformable

Applies a distortion (perspective) to the content under the selection.

Copied to your clipboard
// 'into the distance' effect
await selection.perspectiveTransform(0, -0.05)

Parameters:

NameTypeDescription
percentH
number | PercentValue
Distortion factor in the horizontal axis (percent)
percentV
number | PercentValue
Distortion factor in the vertical axis (percent)
interpolation?
InterpolationMethod
Interpolation method to use when resampling the image @default InterpolationMethod.bilinear

rotate

rotate(angle: number | AngleValue, interpolation?: InterpolationMethod): Promise‹void›

Implementation of Transformable

Rotates the content under the selection.

Copied to your clipboard
// rotate 90 deg counter clockwise
await selection.rotate(-90)

Parameters:

NameTypeDescription
angle
number | AngleValue
Angle to rotate the selection content by in degrees
interpolation?
InterpolationMethod
Interpolation method to use when resampling the image @default InterpolationMethod.bilinear

scale

scale(width: number | PercentValue, height: number | PercentValue, interpolation?: InterpolationMethod): Promise‹void›

Implementation of Transformable

Scales the content under the selection.

Copied to your clipboard
await selection.scale(120, 120)

Parameters:

NameTypeDescription
width
number | PercentValue
Numeric percentage to scale selection content horizontally
height
number | PercentValue
Numeric percentage to scale selection content vertically
interpolation?
InterpolationMethod
Interpolation method to use when resampling the image @default InterpolationMethod.bilinear * > Should this default follow the user preferences?

skew

skew(angleH: number | AngleValue, angleV: number | AngleValue, interpolation?: InterpolationMethod): Promise‹void›

Implementation of Transformable

Applies a skew to the content under the selection.

Copied to your clipboard
// parellelogram shape
await selection.skew(-15, 0)

Parameters:

NameTypeDescription
angleH
number | AngleValue
Horizontal angle to skew by
angleV
number | AngleValue
Vertical angle to skew by
interpolation?
InterpolationMethod
Interpolation method to use when resampling the image @default InterpolationMethod.bilinear

translate

translate(deltaX: number, deltaY: number): Promise‹void›

Translate the entire selection.

Parameters:

NameTypeDescription
deltaX
number
Amount to move selection to the right, in pixels
deltaY
number
Amount to move selection down, in pixels

warp

warp(warp: BuiltinWarp | CustomWarp4X4, interpolation?: InterpolationMethod): Promise‹void›

Implementation of Transformable

Applies a warp to the content under the selection.

Copied to your clipboard
// perform a fisheye warp
await selection.warp({ style: BuiltinWarpStyle.warpFisheye, value: 70 })
// warp selection content using a user provided 4x4 warp grid of points
var bounds = await selection.bounds
var grid = myWarpEngine.generateUniformXYPoints(bounds, 16)
var warp = myWarpEngine.applyWarp(grid)
await selection.warp({ meshPoints: warp })

Parameters:

NameTypeDescription
warp
Warp definition
interpolation?
InterpolationMethod
Interpolation method to use when resampling the image @default InterpolationMethod.bilinear
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2026 Adobe. All rights reserved.