converting .PSD files into .PNG files?
January 17, 2007 10:26 PM   Subscribe

What's the best automated way to convert multilayer .PSD files into multiple .PNG files, for the video game I'm developing?

I'm working on a computer game with an awesome artist. Said artist sends me her art as .PSD files with multiple layers in them.

My game needs .PNG files, with intact alpha channels, and sizes that are powers-of-two (16, 32, 64, 128, etc.)

I'm using Paint Shop Pro 7, which I've generally been very happy with, but it's not set up to do this without a lot of clicking and typing, and this artist is very prolific. So I'm looking for a better way/tool/source.
posted by Emera Gratia to Computers & Internet (11 answers total)
Use Adobe Photoshop and you can automate repetitive tasks using Photoshop Actions.
posted by roomwithaview at 10:38 PM on January 17, 2007

I don't think that's a very helpful suggestion. PSP also has a scripting tool, but the problem is that what he's trying to do isn't "repetitive". Each operation is similar but every one has unique elements (to wit, the filename he wants to save to).
posted by Steven C. Den Beste at 10:59 PM on January 17, 2007

Actions might get you part of the way there but probably won't be flexible enough to do what you want. If you're good with Javascript or VBScript, you can probably write a script to do what you need to do. Photoshop is scriptable and supports both languages, as well as Applescript if you're on a Mac.
posted by doctor_negative at 11:02 PM on January 17, 2007

Each operation is similar but every one has unique elements (to wit, the filename he wants to save to).

Uh, actions can save to filenames with field replacement in batch mode.
posted by Blazecock Pileon at 11:06 PM on January 17, 2007

Response by poster: Well, if I HAVE to pay for a copy of Photoshop, I guess I will, but with my considerable C++ experience, I'd almost rather code a solution (though I haven't found good code/specs on PSD files).

I guess I was hoping some other game developer had run into the same problem and created a specialized art tool that was good at this.
posted by Emera Gratia at 11:11 PM on January 17, 2007

ImageMagick is a wonderful command line tool and application library and it can do some very sophisticated things with images. I believe that it can manipulate PSD layers to some extent.
posted by tumble at 11:30 PM on January 17, 2007

I was hoping some other game developer had run into the same problem

This aspect of the problem doesn't crop up much because generally, it's part of the game artist's job to deliver the art in the exact correct size and format, ready to drop directly into the game.

Another option might be paying your layabout cousin a small amount to do a batch of them for you, but that's probably more hassle than it's worth.
posted by -harlequin- at 12:20 AM on January 18, 2007

Yeah. First of all, usually artists want exact control over what gets exported into the game engine. Secondly, if the artist wants to work professionally in games, being able to save out, say, targas, with the appropriate alpha channel and sizing is part of the skill set she'll need. In a typical workflow, she'll iterate over a single piece of artwork: edit it, export it, see what it looks like in game, edit it again, export it again, etc. (In fact, if you can get her set up to iterate like this, your game will probably look better as a result.)
posted by blenderfish at 12:45 AM on January 18, 2007

I agree, this is something your artist should do.

An artist that provides content needing an unexpected (and not simple) conversion of their art before it's usable is not "an awesome artist". It's in my artists contracts that they must provide art that fits into the work flow. As blenderfish said, artists want that level of control. The last thing they want is a programmer screwing with it.

But if your artist got hit by a bus and you don't have money to hire a production artist to do the conversion, ImageMagick.
posted by Ookseer at 1:44 AM on January 18, 2007

Tell said artist to run this script on her photoshop, which will export all the layers as separate PNG files.

I tried finding a solution with ImageJ, but couldn't work it (though I'm sure it's possible).
posted by kisch mokusch at 4:57 AM on January 18, 2007

nthing that this should be the artist's job, not yours.
posted by mkultra at 9:04 AM on January 18, 2007

« Older Safety in Fiji   |   Help me find evidence concerning the deadliness of... Newer »
This thread is closed to new comments.