javascript - Adding a vector mask to a layer? -
How do I want to know how to add vector mask to Photoshop in the layer provided with Photoshop sript (.jsx)?
I'm not sure what I want in Photoshop is called "vector mask". I have a picture and a mask in black and white, I want to automatically add the mask to the image so that we Can only see under the white area. The black area should have transparent pixels. It should be simple, but I can not find anything at the online doctor ...
Even I have done so ...
var F_image = File Image Ad) Open (f_image) var bgLayer = activeDocument.artLayers [0] bgLayer.isBackgroundLayer = false; Var Masklere = Active Document Starters.ed () masklayer Name = "mask" open (file (mask mask)) // level the document so that we can get everything and then copy the app.activeDocument.flatten () app. Active Document. () App.activeDocument.selection.copy () // We have not saved anything app.activeDocument.close (SaveOptions.DONOTSAVECHANGES) app.activeDocument.paste () // How Mask to set the mask as ????
Thank you!
You do not want vector mask; If you want a layer mask here, here's a function I usually use. It will put a layer mask on the layer with selection. This will not work on an empty layer, although
makeMask () / function mask function makemask () {var id4556 = charIDToTypeID ("setd"); Var desc983 = new action descriptor (); Var id4557 = charIDToTypeID ("null"); Var ref657 = new operation (); Var id4558 = charIDToTypeID ("Chnl"); Var id4559 = charIDToTypeID ("fsel"); Ref657.putProperty (id4558, id4559); Desc983.Putreference (id4557, ref657); Var id4560 = charIDToTypeID ("T"); Var ref658 = new operation (); Var id4561 = charIDToTypeID ("Chnl"); Var id4562 = charIDToTypeID ("Chnl"); Var id4563 = charIDToTypeID ("trsp"); Ref658.putEnumerated (id4561, id4562, id4563); Desc983.Putreference (ID4560, Riff 658); Execution action (id4556, desc983, dialog_modes.no); Var id4564 = charIDToTypeID ("Mk"); Var desc984 = new action descriptor (); Var id4565 = childotope ("nw"); Var id4566 = charIDToTypeID ("Chnl"); Desc984.putClass (id4565, id4566); Var id4567 = charIDToTypeID ("at"); Var ref659 = new operation (); Var id4568 = charIDToTypeID ("Chnl"); Var id4569 = charIDToTypeID ("Chnl"); Var id4570 = charIDToTypeID ("Msk"); Ref659.putEnumerated (id4568, id4569, id4570); Desc984.Putreference (id4567, ref659); Var id4571 = charIDToTypeID ("Usng"); Var id4572 = charIDToTypeID ("UsrM"); Var id4573 = charIDToTypeID ("RvlS"); Desc984.putEnumerated (id4571, id4572, id4573); Execute Actions (ID4564, Dis 984, Dialogmodes.no); }
Comments
Post a Comment