UXP Toolkit
    Preparing search index...

    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.

    group.layers.forEach((layer) => {
    layer.visible = true;
    })
    Index

    Accessors

    Methods

    • Applies the Add Noise filter.

      Unsupported color modes: Indexed Color, Bitmap

      Parameters

      • amount: number

        Percentage of noise applied [0.1,400].

      • distribution: NoiseDistribution

        Distribution method to use.

      • monochromatic: boolean

        Adds black and white noise if true.

      Returns Promise<void>

      23.5

    • Applies the Custom filter.

      Unsupported color modes: Indexed Color, Bitmap

      Parameters

      • characteristics: number[]

        Square matrix (5 x 5) used to perform filter operation.

      • scale: number

        The value by which to divide the sum of the pixel values included in the calculation

      • offset: number

        The value to be added to the result of the scale calculation.

      Returns Promise<void>

      23.5

    • Applies the Diffuse Glow filter.

      Supported color modes: RGB 8 bits, Duotone 8 bits, Grayscale 8 bits, Multichannel 8 bits

      Parameters

      • graininess: number

        The amount of grain [0,10].

      • glowAmount: number

        The glow amount [0,20].

      • clearAmount: number

        The clear amount [0,20].

      Returns Promise<void>

      23.5

    • 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

      Parameters

      • horizontalScale: number

        How much to scale in the direction of width [-999,999].

      • verticalScale: number

        How much to scale in the direction of height [-999,999].

      • displacementType: DisplacementMapType

        Describes how the displacement map fits the image if the image is not the same size as the map.

      • undefinedAreas: UndefinedAreas

        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.

      • displacementMapFile: File

        Path to the distortion image map.

      Returns Promise<void>

      23.5

    • Applies the Dust & Scratches filter.

      Unsupported color modes: Indexed Color, Bitmap, RGB 32 bits, Grayscale 32 bits

      Parameters

      • radius: number

        The radius of the filter in pixels [1,100].

      • threshold: number

        The lower the amount, the stronger the effect [0,255].

      Returns Promise<void>

      23.5

    • Applies the Gaussian Blur filter.

      Unsupported color modes: Indexed Color, Bitmap

      Parameters

      • radius: number

        The radius of the filter in pixels [0.1,250].

      Returns Promise<void>

      23.5

    • Applies the Glass filter.

      Supported color modes: RGB 8 bits, Duotone 8 bits, Grayscale 8 bits, Multichannel 8 bits

      Parameters

      • distortion: number

        Change the amount the glass distorts the image [0,20].

      • smoothness: number

        Change the smoothness of the glass [1,15].

      • scaling: number

        The percentage value to scale by [50,200].

      • Optionalinvert: boolean

        Invert the glass (default: false).

      • Optionaltexture: TextureType

        The type of glass texture. This argument is ignored if "textureFile" is provided. (default: TextureType.CANVAS)

      • OptionaltextureFile: File

        Mapping for glass distortion (optional).

      Returns Promise<void>

      23.5

    • Applies the High Pass filter.

      Unsupported color modes: Indexed Color, Bitmap

      Parameters

      • radius: number

        The width of high pass filter (pixels) [0.1,1000].

      Returns Promise<void>

      23.5

    • 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.

      Parameters

      Returns Promise<void>

      24.5

    • Applies the Lens Blur filter.

      Unsupported color modes: Indexed Color, Bitmap, RGB 32 bits, Grayscale 32 bits

      Parameters

      • Optionalsource: DepthMapSource

        The source for the depth map (default: DepthMapSource.NONE)

      • OptionalfocalDistance: number

        The blur focal distance for the depth map [0,255] (default: 0).

      • OptionalinvertDepthMask: boolean

        True if the depth map is inverted (default: false)

      • Optionalshape: Geometry

        The shape of the iris (default: Geometry.HEXAGON)

      • Optionalradius: number

        The radius of the iris [0,100] (default: 15)

      • OptionalbladeCurvature: number

        The blade curvature of the iris [0,100] (default: 0)

      • Optionalrotation: number

        The rotation of the iris [0,360] (default: 0)

      • Optionalbrightness: number

        The brightness for the specular highlights [0,100] (default: 0)

      • Optionalthreshold: number

        The threshold for the specular highlights [0,255] (default: 0)

      • Optionalamount: number

        The amount of noise [0,100] (default: 0)

      • Optionaldistribution: NoiseDistribution

        The distribution value for the noise (default: NoiseDistribution.UNIFORM)

      • Optionalmonochromatic: boolean

        True if the noise is monochromatic (default: false)

      Returns Promise<void>

      23.5

    • Applies the Lens Flare filter.

      Supported color modes: RGB 8 bits, RGB 16 bits, RGB 32 bits

      Parameters

      • brightness: number

        Percentage of brightness applied [10,300].

      • flareCenter: { x: number; y: number }

        The flare center {x: number, y: number}.

        • x: number

          The horizontal coordinate in pixels.

        • y: number

          The vertical coordinate in pixels.

      • OptionallensType: LensType

        The lens type used to produce the effect (default: LensType.ZOOMLENS).

      Returns Promise<void>

      23.5

    • Applies the Maximum filter

      Unsupported color modes: Indexed Color, Bitmap

      Parameters

      • radius: number

        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: PreserveShape

        Favor hard corners or smooth curves around the edges
        (default: PreserveShape.SQUARENESS)

      Returns Promise<void>

      23.5

    • Applies the Median filter

      Unsupported color modes: Indexed Color, Bitmap, RGB 32 bits, Grayscale 32 bits

      Parameters

      • radius: number

        The radius of the filter in pixels [1,500]

      Returns Promise<void>

      23.5

    • Applies the Minimum filter

      Unsupported color modes: Indexed Color, Bitmap

      Parameters

      • radius: number

        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: PreserveShape

        Favor hard corners or smooth curves around the edges
        (default: PreserveShape.SQUARENESS)

      Returns Promise<void>

      23.5

    • Applies the Motion Blur filter

      Unsupported color modes: Indexed Color, Bitmap

      Parameters

      • angle: number

        The angle the blur effect will be applied at (degrees) [-360,360]

      • distance: number

        The amount of blur [1,2000]

      Returns Promise<void>

      23.5

    • Applies the Ocean Ripple filter

      Supported color modes: RGB 8 bits, Duotone 8 bits, Grayscale 8 bits, Multichannel 8 bits

      Parameters

      • size: number

        The Ripple size [1,15]

      • magnitude: number

        The Ripple magnitude [1,20]

      Returns Promise<void>

      23.5

    • Applies the Offset filter

      Unsupported color modes: Indexed Color, Bitmap

      Parameters

      • horizontal: number

        The horizontal offset [-2 * doc.width, 2 * doc.width]

      • vertical: number

        The vertical offset [-2 * doc.height, 2 * doc.height]

      • OptionalundefinedAreas: OffsetUndefinedAreas

        Method to use to fill the empty space left by the offset
        (default: OffsetUndefinedAreas.WRAPAROUND).

      Returns Promise<void>

      23.5

    • Applies the Pinch filter.

      Unsupported color modes: Indexed Color, Bitmap

      Parameters

      • amount: number

        The pinch amount. Negative value creates effect of expansion and positive creates effect of contraction. [-100,100]

      Returns Promise<void>

      23.5

    • Applies the the Shear filter.

      Unsupported color modes: Indexed Color, Bitmap

      Parameters

      • curve: { x: number; y: number }[]

        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.

      • undefinedArea: UndefinedAreas

        The treatment of areas left blank by the distortion.

      Returns Promise<void>

      23.5

    • 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

      Parameters

      • radius: number

        The blur radius [0.1,100].

      • threshold: number

        The blur threshold [0.1,100].

      • blurQuality: SmartBlurQuality

        The smoothness or graininess of the blurred image.

      • mode: SmartBlurMode

        The smart blur mode.

      Returns Promise<void>

      24.0

    • Applies the Twirl filter.

      Unsupported color modes: Indexed Color, Bitmap

      Parameters

      • angle: number

        The amount of twirl to apply (degrees) [-999,999]

      Returns Promise<void>

      23.5

    • Applies the Unsharp Mask filter.

      Unsupported color modes: Indexed Color, Bitmap

      Parameters

      • amount: number

        The amount of sharpening (as a whole number percentage) [1,500].

      • radius: number

        The radius in pixels [0.1,1000].

      • threshold: number

        The contrast threshold [0,255].

      Returns Promise<void>

      24.0

    • Applies the Wave filter.

      Unsupported color modes: Indexed Color, Bitmap

      Parameters

      • generatorNumber: number

        The whole number of generators [1,999].

      • minimumWavelength: number

        The minimum wave length [1,(maximum wave length - 1)] (whole number).

      • maximumWavelength: number

        The maximum wave length [(minimum wave length + 1),999] (whole number).

      • minimumAmplitude: number

        The minimum amplitude [1,(maximum amplitude - 1)] (whole number).

      • maximumAmplitude: number

        The maximum amplitude [(minimum amplitude + 1),999] (whole number).

      • horizontalScale: number

        The amount of horizontal scale (as a percentage) [1,100] (whole number).

      • verticalScale: number

        The amount of vertical scale (as a percentage) [1,100] (whole number).

      • OptionalwaveType: WaveType

        The wave type (optional).

      • OptionalundefinedAreas: UndefinedAreas

        The treatment of areas left blank by the distortion (optional).

      • OptionalrandomSeed: number

        The random seed (optional).

      Returns Promise<void>

      24.0

    • Applies the ZigZag filter.

      Unsupported color modes: Indexed Color, Bitmap

      Parameters

      • amount: number

        The amount of zigzag [-100,100].

      • ridges: number

        The number of ridges [0,20].

      • style: ZigZagType

        The zigzag style.

      Returns Promise<void>

      24.0