• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to add a simple filter to a layer with a script

Community Beginner ,
Nov 26, 2020 Nov 26, 2020

Copy link to clipboard

Copied

Hello all

 

Just getting started with scripts and JS, so I apologize if this is a dumb question.

How would I add a Gaussian Blur (amount 26) filter to my active layer using a script?

I have been experimenting but have not gotten it to work, thank you all in advance.

TOPICS
Actions and scripting

Views

691

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 27, 2020 Nov 27, 2020

I still think looking at your current code would be best, however, without knowing where you are going wrong, the following diagram should hopefully help:

 

scripting-gblur.png

 

However, as the filter uses values in pixels, it is probably better to add further code to set pixels as the unit rather than just assume. This is probably OK for a simple filter, however, when resizing an image it pays to be specific.

 

Votes

Translate

Translate
Adobe
Community Expert ,
Nov 26, 2020 Nov 26, 2020

Copy link to clipboard

Copied

Post your code, that is the best way to get feedback and learn.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 27, 2020 Nov 27, 2020

Copy link to clipboard

Copied

I still think looking at your current code would be best, however, without knowing where you are going wrong, the following diagram should hopefully help:

 

scripting-gblur.png

 

However, as the filter uses values in pixels, it is probably better to add further code to set pixels as the unit rather than just assume. This is probably OK for a simple filter, however, when resizing an image it pays to be specific.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 27, 2020 Nov 27, 2020

Copy link to clipboard

Copied

Thank you so so much! That diagram definitely makes more sense now.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 27, 2020 Nov 27, 2020

Copy link to clipboard

Copied

LATEST

They can be frustrating, however, they are the official references:

 

https://www.adobe.com/devnet/photoshop/scripting.html

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines