When set to true, prevents edits to pixels and properties of this layer.
The blend mode of the layer.
Fixes in Photoshop 24.2:
Bounds of the layer, including the effects.
Bounds of the layer excluding effects.
The document that contains this layer.
The fill opacity of the layer, in percentage.
The density of the filter mask, in percentage.
The feather of the filter mask between 0.0 and 1000.0.
ID of the layer, can be used for making batchPlay calls.
True when the layer is the special Background layer.
Whether the layer is being used as a clipping mask. Releasing a clipping mask will also release the layers above.
The kind of the layer.
The density of the layer mask, in percentage.
The feather of the layer mask between 0.0 and 1000.0.
Layers linked to this layer. See Layer.link
True if any property of this layer is locked.
Name of the layer.
The master opacity of the layer, in percent.
The group layer that contains this layer. It will return null if the layer is a top layer in the document.
When set to true, prevents the pixels of this layer from being edited.
When set to true, prevents the layer from being moved.
The object that contains properties and methods related to Text
for Layers whose kind is equal to LayerKind.TEXT
When set to true, prevents the transparent pixels from being edited.
The class name of the referenced object: "Layer".
The density of the vector mask, in percentage.
The feather of the vector mask between 0.0 and 1000.0.
True when the layer is visible.
Applies the Add Noise filter.
Unsupported color modes: Indexed Color, Bitmap
Percentage of noise applied [0.1,400].
Distribution method to use.
Adds black and white noise if true.
Applies the Custom filter.
Unsupported color modes: Indexed Color, Bitmap
Square matrix (5 x 5) used to perform filter operation.
The value by which to divide the sum of the pixel values included in the calculation
The value to be added to the result of the scale calculation.
Applies the De-Interlace filter.
Unsupported color modes: Indexed Color, Bitmap, CMYK 8 bits, CMYK 16 bits, Duotone 8 bits
Eliminate EVENFIELDS or ODDFIELDS field order.
Create fields by either DUPLICATION or INTERPOLATION.
Applies the Diffuse Glow filter.
Supported color modes: RGB 8 bits, Duotone 8 bits, Grayscale 8 bits, Multichannel 8 bits
The amount of grain [0,10].
The glow amount [0,20].
The clear amount [0,20].
Applies the Displace filter using the specified horizontal and vertical scale, mapping type, treatment of undistorted areas, and path to the distortion image map.
Unsupported color modes: Indexed Color, Bitmap
How much to scale in the direction of width [-999,999].
How much to scale in the direction of height [-999,999].
Describes how the displacement map fits the image if the image is not the same size as the map.
The method used to treat undistorted areas or areas left blank in an image to which the filter in the Distor category has been applied.
Path to the distortion image map.
Applies the Glass filter.
Supported color modes: RGB 8 bits, Duotone 8 bits, Grayscale 8 bits, Multichannel 8 bits
Change the amount the glass distorts the image [0,20].
Change the smoothness of the glass [1,15].
The percentage value to scale by [50,200].
Optionalinvert: booleanInvert the glass (default: false).
Optionaltexture: TextureTypeThe type of glass texture. This argument is ignored if "textureFile" is provided. (default: TextureType.CANVAS)
OptionaltextureFile: FileMapping for glass distortion (optional).
The applyImage method lets you blend one image’s layer and channel (the source) with a this layer (the target). This will change pixels contained in this layer. Performs Image > Apply Image on the document. See the ApplyImageOptions object for more info and examples.
Option object for applyImage.
Applies the Lens Blur filter.
Unsupported color modes: Indexed Color, Bitmap, RGB 32 bits, Grayscale 32 bits
Optionalsource: DepthMapSourceThe source for the depth map (default: DepthMapSource.NONE)
OptionalfocalDistance: numberThe blur focal distance for the depth map [0,255] (default: 0).
OptionalinvertDepthMask: booleanTrue if the depth map is inverted (default: false)
Optionalshape: GeometryThe shape of the iris (default: Geometry.HEXAGON)
Optionalradius: numberThe radius of the iris [0,100] (default: 15)
OptionalbladeCurvature: numberThe blade curvature of the iris [0,100] (default: 0)
Optionalrotation: numberThe rotation of the iris [0,360] (default: 0)
Optionalbrightness: numberThe brightness for the specular highlights [0,100] (default: 0)
Optionalthreshold: numberThe threshold for the specular highlights [0,255] (default: 0)
Optionalamount: numberThe amount of noise [0,100] (default: 0)
Optionaldistribution: NoiseDistributionThe distribution value for the noise (default: NoiseDistribution.UNIFORM)
Optionalmonochromatic: booleanTrue if the noise is monochromatic (default: false)
Applies the Lens Flare filter.
Supported color modes: RGB 8 bits, RGB 16 bits, RGB 32 bits
Percentage of brightness applied [10,300].
The flare center {x: number, y: number}.
The horizontal coordinate in pixels.
The vertical coordinate in pixels.
OptionallensType: LensTypeThe lens type used to produce the effect (default: LensType.ZOOMLENS).
Applies the Maximum filter
Unsupported color modes: Indexed Color, Bitmap
The radius of the filter in pixels.
Integer in the range [1,500] when using SQUARENESS.
Float in the range [0.2,500] when using ROUNDNESS.
OptionalpreserveShape: PreserveShapeFavor hard corners or smooth curves around the edges
(default: PreserveShape.SQUARENESS)
Applies the Minimum filter
Unsupported color modes: Indexed Color, Bitmap
The radius of the filter in pixels.
Integer in the range [1,500] when using SQUARENESS.
Float in the range [0.2,500] when using ROUNDNESS.
OptionalpreserveShape: PreserveShapeFavor hard corners or smooth curves around the edges
(default: PreserveShape.SQUARENESS)
Applies the Offset filter
Unsupported color modes: Indexed Color, Bitmap
The horizontal offset [-2 * doc.width, 2 * doc.width]
The vertical offset [-2 * doc.height, 2 * doc.height]
OptionalundefinedAreas: OffsetUndefinedAreasMethod to use to fill the empty space left by the offset
(default: OffsetUndefinedAreas.WRAPAROUND).
Applies the Polar Coordinates filter.
Unsupported color modes: Indexed Color, Bitmap
The conversion type.
Applies the Ripple filter.
Unsupported color modes: Indexed Color, Bitmap
The ripple amount. [-999,999]
The ripple size.
Applies the the Shear filter.
Unsupported color modes: Indexed Color, Bitmap
Specification of the shear curve in points as coordinates object with x, y properties e.g.in the format [{x:-20, y:1}, {x:30, y:128}]. Any number higher than 2 of coordinate objects can be specified. For "x" coordinate it is recommended to use range [-63,64] and for "y" coordinate use range [1,128]. For bests results please make sure that first point has 0 at "y" axis and last point has 128 at "y" axis. Also sort points by "y" value in ascending order. Follow these rules to ensure that curve will be shown correctly in dialog UI.
The treatment of areas left blank by the distortion.
Applies the Smart Blur filter.
Supported color modes: RGB 8 bits, CMYK 8 bits, Duotone 8 bits,
Grayscale 8 bits, Lab 8 bits, Multichannel 8 bits
The blur radius [0.1,100].
The blur threshold [0.1,100].
The smoothness or graininess of the blurred image.
The smart blur mode.
Applies the Spherize filter.
Unsupported color modes: Indexed Color, Bitmap
The amount of distortion [-100,100].
The distortion mode.
Applies the Unsharp Mask filter.
Unsupported color modes: Indexed Color, Bitmap
The amount of sharpening (as a whole number percentage) [1,500].
The radius in pixels [0.1,1000].
The contrast threshold [0,255].
Applies the Wave filter.
Unsupported color modes: Indexed Color, Bitmap
The whole number of generators [1,999].
The minimum wave length [1,(maximum wave length - 1)] (whole number).
The maximum wave length [(minimum wave length + 1),999] (whole number).
The minimum amplitude [1,(maximum amplitude - 1)] (whole number).
The maximum amplitude [(minimum amplitude + 1),999] (whole number).
The amount of horizontal scale (as a percentage) [1,100] (whole number).
The amount of vertical scale (as a percentage) [1,100] (whole number).
OptionalwaveType: WaveTypeThe wave type (optional).
OptionalundefinedAreas: UndefinedAreasThe treatment of areas left blank by the distortion (optional).
OptionalrandomSeed: numberThe random seed (optional).
Applies the ZigZag filter.
Unsupported color modes: Indexed Color, Bitmap
The amount of zigzag [-100,100].
The number of ridges [0,20].
The zigzag style.
Moves the layer to a position above the topmost layer or group.
Clears the layer pixels and does not copy to the clipboard. If no pixel selection is found, select all pixels and clear.
Copies the layer to the clipboard. When the optional argument is set to true, a merged copy is performed (that is, all visible layers are copied to the clipboard).
Optionalmerge: booleanWhether to perform a merged copy.
Cuts the layer contents to the clipboard. If no selection is found then select all the pixels and then cut.
Deletes this layer from the document.
Number of layer elements deleted.
Duplicates the layer, creating a copy above it in layer stack, and returns the newly created layer.
OptionalrelativeObject: Document | LayerIf specified, duplicate to a different document or relative to another layer.
OptionalinsertionLocation: ElementPlacementWhere to insert the duplicated layer.
Optionalname: stringName for the duplicated layer.
Flips the layer on one or both axis.
Which axis (or both) to flip the layer on. - "horizontal": flip layer on horizontal axis - "vertical": flip layer on vertical axis - "both": flip layer on both axes
Merges layers. This operates on the currently selected layers. If multiple layers are selected, they will be merged together. If one layer is selected, it is merged down with the layer beneath. In this case, the layer below must be a pixel layer. The merged layer will now be the active layer.
Moves the layer relative to the layer specified in parameters.
"placeAfter" places the layer below relativeObject.
"placeBefore" places the layer above relativeObject.
"placeInside" places the layer inside relativeObject if relativeObject is a group layer.
ElementPlacement.PLACEINSIDE is only valid when relativeObject.kind === LayerKind.group
The layer to move relative to.
Where to place the layer.
Converts the targeted contents in the layer into a flat, raster image.
Rotates the layer.
Angle to rotate the layer by in degrees.
Optionalanchor: AnchorPositionAnchor position to rotate around.
Optionaloptions: { interpolation?: InterpolationMethod }Optionalinterpolation?: InterpolationMethodInterpolation method to use when resampling the image.
Scales the layer.
Renamed from resize in ExtendScript.
Numeric percentage to scale layer horizontally.
Numeric percentage to scale layer vertically.
Optionalanchor: AnchorPositionAnchor position to rotate around.
Optionaloptions: { interpolation?: InterpolationMethod }Optionalinterpolation?: InterpolationMethodInterpolation method to use when resampling the image.
Moves the layer to the bottom. If the bottom layer is the background, it will move the layer to the position above the background. If it is in a group, it will move to the bottom of the group.
Applies a skew to the layer.
Horizontal angle to skew by.
Vertical angle to skew by.
Optionaloptions: { interpolation?: InterpolationMethod }Optionalinterpolation?: InterpolationMethodInterpolation method to use when resampling the image.
Moves the layer (translation).
Numeric value to offset layer by in pixels or percent.
Numeric value to offset layer by in pixels or percent.
Unlinks the layer from any existing links.
An object within a document that contains visual elements of the image, equivalent to a layer in Photoshop.
You can access layers in a document using Document.layers collection.
If the object is representing a group layer, you can access it's children layers using Layer.layers property.
See
https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/
Example