以编程方式编辑 Photoshop PSD 文本图层 [英] Editing Photoshop PSD text layers programmatically

查看:53
本文介绍了以编程方式编辑 Photoshop PSD 文本图层的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个多层 PSD,其中一个特定层是非光栅化文本.我正在尝试从 bash/perl/python/whatever-else 程序中找出一种方法:

I have a multi-layered PSD, with one specific layer being non-rasterized text. I'm trying to figure out a way I can, from a bash/perl/python/whatever-else program:

  1. 加载PSD
  2. 编辑所述图层中的文本
  3. 展平图像中的所有图层
  4. 另存为网页友好格式,如 PNG 或 JPG

我立即想到了ImageMagick,但我认为我无法通过 IM 编辑文本层.如果我可以通过其他编程方式完成前两个步骤,我总是可以使用 ImageMagick 来执行最后两个步骤.

I immediately thought of ImageMagick, but I don't think I can edit the text layer through IM. If I can accomplish the first two steps some other programmatic way, I can always use ImageMagick to perform the last two steps.

在谷歌搜索和搜索 CPAN 和 PyPI 几个小时后,我仍然没有发现任何有希望的东西.有人对这个主题有什么建议或想法吗?

After a couple of hours of googling and searching CPAN and PyPI, I still have found nothing promising. Does anyone have advice or ideas on the subject?

推荐答案

如果您不喜欢使用官方支持的 AppleScript、JavaScript 或 VBScript,那么也可以使用 Python 来实现.这在文章使用 Python 编写 Photoshop 脚本 中有说明,它依赖于 Photoshop 的 COM 接口.

If you don't like to use the officially supported AppleScript, JavaScript, or VBScript, then there is also the possibility to do it in Python. This is explained in the article Photoshop scripting with Python, which relies on Photoshop's COM interface.

我还没有尝试过,所以如果它对你不起作用:如果您的文本在 转换为 SVG 然后你可以简单地用你喜欢的任何工具替换它.之后,将其转换为 PNG(例如,通过 inkscape --export-png=...).

I have not tried it, so in case it does not work for you: If your text is preserved after conversion to SVG then you can simply replace it by whatever tool you like. Afterwards, convert it to PNG (eg. by inkscape --export-png=...).

这篇关于以编程方式编辑 Photoshop PSD 文本图层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆