Skip to main content
martinj65399781
Known Participant
March 27, 2021
Question

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

  • March 27, 2021
  • 2 replies
  • 265 views

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.

 

 

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

    This topic has been closed for replies.

    2 replies

    Peru Bob
    Community Expert
    Community Expert
    March 27, 2021

    Moved to the Photoshop forum.

    Legend
    March 27, 2021

    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.

    martinj65399781
    Known Participant
    March 27, 2021

    oh sorry,  it is for Photoshop 🙂 thanks