扩展脚本。如何将artlayer另存为png
如何将 ArtLayer 保存为 png 文件?我可以使用任何 Action API 吗?
var layer = activeDocument.layers[2];
layer.copy();
var myDoc = app.documents.add(2000, 1000, 72, 'export-demo');
myDoc.paste();
var type = new PNGSaveOptions();
var fileSpec = new File("e:/ps/" + layer.name + ".png");
myDoc.saveAs(fileSpec, type);
How can i save a ArtLayer as a png file? Are there any Action APIs I can use?
var layer = activeDocument.layers[2];
layer.copy();
var myDoc = app.documents.add(2000, 1000, 72, 'export-demo');
myDoc.paste();
var type = new PNGSaveOptions();
var fileSpec = new File("e:/ps/" + layer.name + ".png");
myDoc.saveAs(fileSpec, type);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请注意:我没有代表可以发表评论并询问更多详细信息。所以我想我只会发布我所知道的答案。
有几种方法可以实现这一点。但我发现最简单的方法是关闭所有其他图层的可见性,然后导出 PNG。这看起来像这样:
此方法的缺点是它仅导出到 PSD 的大小,而不会裁剪到图层图像尺寸。
Please note: I don't have the rep to comment and ask for more details. So I figured that I would just post the answer that I know.
There would be a few ways to accomplish this. But the easiest way that I've found to do this is to turn off the visibility of all other layers, then export a PNG. This would look something like this:
The downside to this method is that it only exports to the size of the PSD and does not crop to the layer image dimensions.