Search code examples
iosgraphicsphotoshopphotoshop-script

Extracting images from PSD for use in iOS app


I'm not sure if this is the best forum for this, because it's not a programming question per se, but here goes.

I am the developer for an iOS application, and we contracted the design out to a third-party. They delivered to us a massive PhotoShop file with all of the the individual pieces of artwork done on individual layers, at double resolution. To get the artwork into XCode, my workflow is as follows:

  1. Show only the layers containing a particular unit of artwork
  2. Select all
  3. Copy Merged
  4. Create New image (fortunately, the dimensions are taken care of automatically)
  5. Paste
  6. Deselect pasted layer and delete Background, to preserve transparency
  7. Save image as x.psd
  8. Save copy as [email protected]
  9. Set image size to 50% of original dimensions
  10. Save copy as x.png
  11. Discard changes

This app is pretty large, so it's quite tedious to do this process for every little image. I'm not very Photoshop savvy, so I'm wondering if there is a better way. It seems to me that it should be easy enough to combine steps 3-11 into one macro or script or something. The only thing that changes in each iteration over these steps is the output name. Any suggestions?


Solution

  • You can script Photoshop with Javascript and I've written scripts in the past to perform similar series of steps, it wasn't too hard to figure out even for someone like me who'd never written any Javascript before. Photoshop also has 'Actions' which are like macros and you can probably do something simple like this with Actions as well but it's not something I've personally tried. Check out the Adobe docs on scripting Photshop: Adobe Photoshop Scripting.