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

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

问题描述

我需要使用ImageMagick或Linux平台上提供的任何其他命令行工具创建分层的PSD文件。因为我需要在Linux服务器上这样做,我不能使用Photoshop脚本。



下面的ImageMagick命令创建一个单层的PSD文件, :血浆分形)一个在另一个下面。 (我使用ImageMagick 6.5.3-10 2009-07-31 Q16,最新在MacPorts。)

  convert -size 100x100等离子体:fractal plasma:fractal -append out.psd 

如何创建PSD文件,



或者,有没有其他命令行工具允许我这样做?



更新: GIMP命令行之外的任何其他选项

解决方案

如果ImageMagick无法运作,请参阅 Gimp命令列



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

 > (gimp-image-new 200 200 0)
(1)
> (gimp-layer-new 1 200 200 0layer-1100 0)
(2)
> (gimp-layer-new 1 200 200 0layer-2100 0)
(3)
> (file-psd-save 0 1 0test.psdtest.psd0 0)
> (gimp-image-add-layer 1 2 -1)
> (gimp-image-add-layer 1 3 -1)
> (file-psd-save 0 1 1test.psdtest.psd0 0)

这需要转换成脚本文件脚本(.scm文件),并可以从命令行执行,像这样:

  gimp -i -b'(your-script-nametest.psd200 200)'-b'(gimp-quit 0)'
pre>

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.

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

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?

Update: Any other options than GIMP command line?

解决方案

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

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)

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天全站免登陆