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

查看:528
本文介绍了以编程方式编辑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

  1. load the PSD
  2. edit the text in said layer
  3. flatten all layers in the image
  4. save as a web-friendly format like PNG or 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天全站免登陆