透明gif转PNG批量处理抗锯齿
我有大量图像,这些图像最初具有黑色背景,然后去除纯黑色,使图像具有像素化的暗边缘。
我正在寻找一种方法来批量处理这些图像,以颜色擦除与透明像素相邻的黑色像素,或者平滑边缘,使黑色边缘不呈锯齿状。
我有 xnview、irfanview 和 GIMP,但除了使用 GIMP 手动操作之外,我找不到合适的方法来执行此操作,即在透明区域使用魔棒,增长一个像素,然后对黑色进行颜色擦除。
有什么想法吗?我说的是超过 800 张图像,因此批处理非常重要。它们是从 3D 模型自动生成的。
在此期间我会继续四处寻找!
I have a large amount of images which at first had a black background, then the solid black color was removed leaving the image with pixelated dark-edges.
I am looking for a way to batch process these images to either color-erase the black pixels adjacent to transparent pixels, or to smooth the edge leaving the black edges not as jagged.
I had xnview, irfanview, and GIMP, but I cannot find a suitable method for doing this other than manually with GIMP by using the magic wand on transparent area, growing by one pixel, and color-erasing the black color.
Any ideas? I'm talking over 800 images, so batch processing is pretty important. They are automatically generated from 3d models.
I'll keep looking around in the mean time!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Photoshop 是可编写脚本的,据我所知 gimp 也是如此。 Photoshop 具有 vbscript、javascript 和 apple(脚本?)的脚本参考以及 PDF 格式埋藏在已安装文件夹中的示例。检查文档。
我抄袭了一种从论坛帖子中选择透明度的技术并将其移植到 vbscript 中。它创建一个临时操作,然后在(传递的)当前应用程序引用中选择当前图层的透明度。参考资料中介绍了打开文件、保存文件等的基础知识。
下面的 vbscript 示例将找到 Photoshop,将其置于最前面,然后尝试在当前打开的文档中加载透明度。 Obvious Man 表示,如果您尚未打开 PS 并加载文档,或者您的文档未应用透明度,则此操作将会失败。 YMMV。
Photoshop is scriptable, and AFAIK gimp is as well. Photoshop has scripting references for vbscript, javascript, and apple(script?) as well as samples buried in the installed folders in PDF format. Check the docs.
I cribbed a technique for selecting transparency from a forum post and ported it to vbscript. It creates a temporary Action which then selects the transparency of the current layer in the (passed) current application reference. The basics of opening files, saving files etc is covered in the references.
The vbscript sample below will find photoshop, bring it to the front, and then attempt to load the transparency in the currently open document. Obvious Man says that this will fail if you haven't already opened PS and loaded a document, or if your document has no transparency applied. YMMV.