向图层添加矢量蒙版?
我想知道如何使用 Photoshop sript (.jsx) 将 Photoshop 中的矢量蒙版添加到给定图层?
我不是 100% 确定我想要的东西在 Photoshop 中被称为“矢量蒙版”。 我有一张黑白图片和一个蒙版,我想自动将蒙版添加到图像中,这样我们只能看到白色区域下方的内容。 黑色区域下方必须是透明像素。 这一定很简单,但我在在线文档上找不到任何内容...
这是我到目前为止所做的...
var f_image = File(imageAdress)
open(f_image)
var bgLayer = activeDocument.artLayers[0]
bgLayer.isBackgroundLayer = false;
var maskLayer = activeDocument.artLayers.add()
maskLayer.name = "mask"
open(File(maskAdress))
// flatten the document so we get everything and then copy
app.activeDocument.flatten()
app.activeDocument.selection.selectAll()
app.activeDocument.selection.copy()
// don’t save anything we did
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES)
app.activeDocument.paste()
// 如何将蒙版设置为蒙版???
谢谢 !
i'd like to know how to add a vector mask in photoshop to a given layer with photoshop sript (.jsx)?
I m not 100% sure what i want is called "vector mask" in photoshop.
I've got a picture and a mask in black and white, i'd like to automaticly add the mask to the image so we can only see what is under the white region.
Under the black region must be transparent pixel.
this must be simple but i can't find anything on the online doc...
here is what i did so far...
var f_image = File(imageAdress)
open(f_image)
var bgLayer = activeDocument.artLayers[0]
bgLayer.isBackgroundLayer = false;
var maskLayer = activeDocument.artLayers.add()
maskLayer.name = "mask"
open(File(maskAdress))
// flatten the document so we get everything and then copy
app.activeDocument.flatten()
app.activeDocument.selection.selectAll()
app.activeDocument.selection.copy()
// don’t save anything we did
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES)
app.activeDocument.paste()
// how to set the mask as a mask????
Thanks !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你不需要矢量蒙版;你想要图层蒙版。这是我通常使用的一个功能。它将在带有选区的图层上放置图层蒙版。但是,它不适用于空层
You don't want vector mask; you want layer masks. Here's a function that I normally use. It'll put a layer mask on a layer with a selection. It won't work on a empty layer, however
我不确定如何通过脚本实现此目的,但要将矢量蒙版添加到图层,您必须:
I'm not sure how to make this via script, but to add a vector mask to a layer you have to: