How can I parse, manipulate, and save Adobe Photoshop files?

2.6k Views Asked by At

How can I write a script or program to manipulate Adobe Photoshop files? I'd like to be able to do something like read a Adobe PSD file, rename the layers, and save it back to a PSD format.

The files look to be saved with a combination of XML and serialized data. I looked at the file's code and see that it has <x:xmpmeta near the start, did some google searching to find the wikipedia article about xmp - Extensible Metadata Platform, but I'm unclear if that is the format for the entire file or just for the metadata portion.

I saw that there is a PSD parser class for PHP available, and not a bad article about how to use it, although it seems like it is just for reading / converting and not for writing / saving.

But I'd like to know:

  1. What format are these files stored in?
  2. Where are the guidelines for interfacing with that format?
  3. Are there some classes / tools available for manipulating that file format? Any language would be fine for a start.

I'm happy to do more research on my own but I'm hoping for some guidance to know what I should be looking for.

2

There are 2 best solutions below

1
On BEST ANSWER

I'm not familiar with it myself, but there is an official SDK for Photoshop available that should let you do all that and more with .psd files.

0
On

There are not so many options. The general advice would be to look into buying Adobe InDesign Server. In some cases it can be cost prohibitive and you might be interested in 3-party SDKs. Unfortunately there are a few options in the market. One of them is Graphics Mill image processing SDK (http://www.graphicsmill.com/photoshop-psd).

Disclaimer: I work for Aurigma which runs Graphics Mill project.