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

applying blend mode for layer

Community Beginner ,
May 08, 2024 May 08, 2024

hi all,
i have 2 layer layer2 and layer1
layer2 is top layer and layer1 is a bottom layer.
here i want apply blend mode exclusion for layer2 
through code how can we apply blend mode for layer.
please provide me code for this and if possible can anyone help me to provide code for other blending mode too.
Thank You

TOPICS
Actions and scripting , SDK
338
Translate
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 , May 08, 2024 May 08, 2024

Presuming ExtendScript, here is DOM code for changing the blend mode without selecting the top layer, regardless of the layer name:

 

app.activeDocument.layers[0].blendMode = BlendMode.EXCLUSION;

 

Or by selecting the top layer, then changing it's blend mode, regardless of the layer name:

 

app.activeDocument.activeLayer = app.activeDocument.layers[0];
app.activeDocument.activeLayer.blendMode = BlendMode.EXCLUSION;

 

https://theiviaxx.github.io/photoshop-docs/Photoshop/BlendMode.html

 

Edit:

 

I

...
Translate
Adobe
Community Expert ,
May 08, 2024 May 08, 2024

Presuming ExtendScript, here is DOM code for changing the blend mode without selecting the top layer, regardless of the layer name:

 

app.activeDocument.layers[0].blendMode = BlendMode.EXCLUSION;

 

Or by selecting the top layer, then changing it's blend mode, regardless of the layer name:

 

app.activeDocument.activeLayer = app.activeDocument.layers[0];
app.activeDocument.activeLayer.blendMode = BlendMode.EXCLUSION;

 

https://theiviaxx.github.io/photoshop-docs/Photoshop/BlendMode.html

 

Edit:

 

I you want to use the explicit layer name:

 

app.activeDocument.layers.getByName("Layer 2").blendMode = BlendMode.EXCLUSION;

 

or

 

app.activeDocument.activeLayer = app.activeDocument.layers.getByName("Layer 2");
app.activeDocument.activeLayer.blendMode = BlendMode.EXCLUSION;

 

Translate
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 ,
May 08, 2024 May 08, 2024
LATEST

Could you please post screenshots taken at View > 100% with the pertinent Panels (Toolbar, Layers, Options Bar, …) visible? 

Can there be more Layers in the image? 

Translate
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