Photoshop Javascript : load selection of opaque pixels but not the transparent pixels.
Photoshop Javascript : load selection of opaque pixels but not the transparent pixels of a layer.
I really despair to achieve this in a simple javascript script.
I kinda understood I needed to first load a channel, and then perform a selection from this channel, but I just failed doing this. I don't know how to get the corresponding channel that contains the transparent pixels of the current layer.
The original file is a PNG, it has a single layer.
There is no alpha channel, only R, G and B, although the image has transparent areas.
When I go to select, load Selection, Photoshop suggests by default a channel called layer_name+" Transparency",
therefore I tried something like:
doc.selection.load(doc.channels[layer_name + "Transparency"], SelectionType.EXTEND);
But this just failed.
I think I don't understand the way I am supposed to work with selections and channels
Thanks for any help!
Bill
