With Photoshop v23.5 comes exciting new additions to the Photoshop DOM API! Thanks to @DavideBarranca and @Jarda’s efforts, we’re happy to introduce new methods to apply filters to layers.
In case you missed the updated changelog, below is a comprehensive list:
- Layer.applyAddNoise(amount:number, distribution:Constants.NoiseDistribution, monochromatic:boolean) Applies the Add Noise filter.
- Layer.applyAverage() Applies the Average filter.
- Layer.applyBlur() Applies the Blur filter.
- Layer.applyBlurMore() Applies the Blur More filter.
- Layer.applyClouds() Applies the Clouds filter.
- Layer.applyCustomFilter(characteristics:number[], scale:number, offset:number) Applies the Custom filter.
- Layer.applyDeInterlace(eliminateFields:Constants.EliminateFields, createFields:Constants.CreateFields) Applies the De-Interlace filter.
- Layer.applyDespeckle() Applies the Despeckle filter.
- Layer.applyDifferenceClouds() Applies the Difference Clouds filter.
- Layer.applyDiffuseGlow(graininess:number, glowAmount:number, clearAmount:number) Applies the Diffuse Glow filter.
- Layer.applyDisplace(horizontalScale:number, verticalScale:number, displacementType:Constants.DisplacementMapType, undefinedAreas:Constants.UndefinedAreas, displacementMapFile:string) Applies the Displace filter.
- Layer.applyDustAndScratches(radius:number, threshold:number) Applies the Dust and Scratches filter.
- Layer.applyGaussianBlur(radius:number) Applies the Gaussian Blur filter.
- Layer.applyGlassEffect(distortion:number, smoothness:number, scaling:number, invert:boolean, texture:Constants.TextureType, textureFile?:string) Applies the Glass filter.
- Layer.applyHighPass(radius:number) Applies the High Pass filter.
- Layer.applyLensBlur(source:Constants.DepthMapSource, focalDistance:number, invertDepthMask:boolean, shape:Constants.Geometry, radius:number, bladeCurvature:number, rotation:number, brightness:number, threshold:number, amount:number, distribution:Constants.NoiseDistribution, monochromatic:boolean) Applies the Lens Blur filter.
- Layer.applyLensFlare(brightness:number, flareCenter:number[], lensType:Constants.LensType) Applies the Lens Flare filter.
- Layer.applyMaximum(radius:number, preserveShape:Constants.PreserveShape) Applies the Maximum filter.
- Layer.applyMinimum(radius:number, preserveShape:Constants.PreserveShape) Applies the Minimum filter.
- Layer.applyMedianNoise(radius:number) Applies the Median Noise filter.
- Layer.applyMotionBlur(angle:number, distance:number) Applies the Motion Blur filter.
- Layer.applyNTSC() Applies the NTSC filter.
- Layer.applyOceanRipple(size:number, magnitude:number) Applies the Ocean Ripple filter.
- Layer.applyOffset(horizontal:number, vertical:number, undefinedAreas:Constants.OffsetUndefinedAreas) Applies the Offset filter.
- Layer.applyTwirl(angle:number) Applies the Twirl filter.
- Layer.applyPinch(amount: number) Applies the Pinch filter.
- Layer.applyPolarCoordinates(conversion: Constants.PolarConversionType) Applies the Polar Coordinates filter.
- Layer.applyRipple(amount: number, size: Constants.RippleSize) Applies the Ripple filter.
- Layer.applySharpen() Applies the Sharpen filter.
- Layer.applySharpenEdges() Applies the Sharpen Edges filter.
- Layer.applySharpenMore() Applies the Sharpen More filter.
- Layer.applyShear(curve: {x:number, y:number}[], undefinedArea: Constants.UndefinedAreas) Applies the Shear filter.
We hope you try them out and let us know what you think!