Command line manipulation of PhotoShop images

2019-02-10 16:30发布

问题:

Are there any tools for editing PhotoShop files from a command line?

I would like to add steps to our automated build process (MS Build) that takes original PhotoShop files that our artists make and produce .png files; I'm looking at a very few operations like photoshop-to-png, resize and possibly showing/hiding layers. I haven't had a lot of luck finding a tool I can use for this.

If it is possible to script this with Photoshop itself, or a Photoshop utility, that'd be awesome.

回答1:

You've got a few options in your case:

  1. Using variables/datasets in Photoshop
  2. As b3bop, using JavaScript(jsx). Quickest way to get started is to open up ExtendScriptToolkit (should be in the Adobe Utilities),connect to Photoshop and open the Object Model Viewer for Photoshop.If it helps, Photoshop also supports VB on Windows.
  3. CommandLine manipulation via Matlab/Photoshop (though this might be a bit much for your current use case).


回答2:

I know that you are looking to use Photoshop, but one non-photoshop option is an open source tool called Image Magick. It has a command line tool that is extremely flexible.

http://www.imagemagick.org/



回答3:

Ive never done this, but I believe you can control PS with JavaScript. You might find this document helpful: http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/photoshop/pdfs/photoshop_cs5_scripting_guide.pdf



回答4:

ImageMagick, GraphicsMagick (a fork of the former; for the former you would use the convert CLI, for the latter you would invoke gm convert), nConvert, Krita CLI, and probably a Gimp CLI, or GMIC--these can all accomplish this.

All will accept a Photoshop file as input, and output virtually (if not actually) the entire range of existing image formats (including Photoshop).