psdump is a command line utility which parses Photoshop files and outputs their layer hierarchy as a text, JSON, or XML data. Position and size of each layer are included in the output.
The program has been tested on the following systems:
- Mac OS X
- Windows XP, 7
- Linux (Ubuntu 9.10)
When used on Mac OS X with a Photoshop file slightly larger than the
most basic one, psdump crashes with
Segmentation fault. The reason
of the crash is supposedly a bug in the libpsd. Further
investigation is planned for an unknown moment in the indefinite future.
In order to start using psdump you will likely need to build it from source. However, there are precompiled binaries for Mac OS X and Windows family. They can be found on the Downloads page.
Once you've downloaded a binary release for your OS, unzip it and type
psdump --help in the terminal window.
Building from source
The UNIX way
Building from source is fairly simple on a UNIX-like system. You just
need to run
make in the terminal window. The binary will appear in a
newly created 'build' directory. (If you are running some kind of
minimalistic Linux distribution, you may need to additionally install
You can also run
make test to run the test-suite and
make tidyup to
remove intermediate object files. (If you don't have python
make shtest instead of
Instructions for Windows users
To build from source on Windows there are several options.
Another way to build psdump is using Cygwin. With 'g++'
and 'make' packages installed, you just need to run
make in the
Important notice. If you build psdump using Cygwin, it won't work without cygwin1.dll.
Lastly, a Microsoft compiler can be used to build from source. You will find a Visual Studio project file in the 'vcproj' directory. This file has been created in MS Visual Studio 2005 (version 9).
To parse Photoshop files, libpsd is used. You don't need to download it separately since its source code is already included with psdump and it hasn't changed since, I guess, 2007. You may visit its project page on SourceForge.net.
Apart from libpsd, there are no other requirements to be able to successfully build psdump from source.
Feedback, feature requests, and code reviews are most welcome! Please let me know about your experience using psdump.
It has been designed in such a way that makes it easy to add more output formats and even to parse other hierarchical files, not just Photoshop ones.
The following improvements are expected to be introduced in the future:
- provide more detailed documentation on adding new features
- check for conformance of JSON and XML outputs to their corresponding specifications
- tweak the program architecture to make it easy to handle multiple document outputs into a single file in a polymorphic way
- write unit-tests and create a more elaborate test-suite
- build and test on as many platforms as possible (your help will be appreciated)
Once the above features are implemented, version 1.0 will be released.