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

In Javascript , how to crop the canvas from layer mask bounds ?

Community Beginner ,
Mar 27, 2021 Mar 27, 2021

Copy link to clipboard

Copied

Hello, despite all my researches i am struggling on this, i need to export multiple crops of an image, determined by the layers in the group "Gp CADRAGE".

 

I need to either :

- get the layermask active, invert it, and then crop to bounds of the mask

- or get a selection of the layer mask of active layer, invert it, and then crop to doc.selection.bounds

 

I tried to get a selection from the layer mask and then invert it, but i cannot select the layer mask propertly.

I tried to invert the alpha channel but i cannot get the alpha channel of the layer mask active.

 

Capture d’écran 2021-03-27 à 10.03.48.pngCapture d’écran 2021-03-27 à 10.10.33.png

 

I suppose that we can do it with actiondescriotor and actionreference etc, but don't understand how it works yet. So didn't get the code i found on the net to work 🙂

 

Thanks a lot if you can help me !

Martin

Views

120

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
Adobe
LEGEND ,
Mar 27, 2021 Mar 27, 2021

Copy link to clipboard

Copied

Adobe have many apps, and a lot of them have JavaScript. Please tell us the name of the app you are using, so your question can be moved to the best expert forum.

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 ,
Mar 27, 2021 Mar 27, 2021

Copy link to clipboard

Copied

oh sorry,  it is for Photoshop 🙂 thanks

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 ,
Mar 27, 2021 Mar 27, 2021

Copy link to clipboard

Copied

LATEST

Moved to the Photoshop forum.

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