如何从命令行创建分层 PSD 文件? [英] How to create a layered PSD file from command line?

查看:29
本文介绍了如何从命令行创建分层 PSD 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用 ImageMagick 或 Linux 平台上可用的任何其他命令行工具创建一个分层的 PSD 文件.由于我需要在 Linux 服务器上执行此操作,因此无法使用 Photoshop 脚本.

I need to create a layered PSD file with ImageMagick or any other command-line tool available on Linux platform. Since I need to do this on Linux server, I can't use Photoshop scripting.

下面的 ImageMagick 命令创建具有单层的 PSD 文件,其中两个图像(此处:等离子分形)位于另一个下方.(我使用 ImageMagick 6.5.3-10 2009-07-31 Q16,MacPorts 中的最新版本.)

The ImageMagick command below creates PSD file with a single layer, where two images (here: plasma fractals) are positioned one below another. (I use ImageMagick 6.5.3-10 2009-07-31 Q16, latest available in MacPorts.)

convert -size 100x100 plasma:fractal plasma:fractal -append out.psd

如何创建一个 PSD 文件,其中每个图像都在自己的图层中,并且一个图层直接位于另一个图层之上?

How do I create a PSD file where each image is in its own layer, and one layer is directly above another?

或者,有没有其他命令行工具可以让我这样做?

Or, is there any other command line tool that would allow me to do this?

更新:除了 GIMP 命令行之外还有其他选项吗?

Update: Any other options than GIMP command line?

推荐答案

如果 ImageMagick 不起作用,我会查看 Gimp 命令行.

If ImageMagick won't work, I'd look at Gimp command line.

以下命令在交互式控制台中为我创建了一个 2 层 PSD 文件:

The following commands created a 2-layer PSD file for me in the interactive console:

> (gimp-image-new 200 200 0)
(1)
> (gimp-layer-new 1 200 200 0 "layer-1" 100 0)
(2)
> (gimp-layer-new 1 200 200 0 "layer-2" 100 0)
(3)
> (file-psd-save 0 1 0 "test.psd" "test.psd" 0 0)
> (gimp-image-add-layer 1 2 -1)
> (gimp-image-add-layer 1 3 -1)
> (file-psd-save 0 1 1 "test.psd" "test.psd" 0 0)

这需要转换成 script-fu 脚本(.scm 文件),并且可以从命令行执行,如下所示:

That would need to be converted into a script-fu script (.scm file) and could be executed from the command-line with something like this:

gimp -i -b '(your-script-name "test.psd" 200 200)' -b '(gimp-quit 0)'

这篇关于如何从命令行创建分层 PSD 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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