Extract images from PSD for use in iOS app

I am not sure if this is the best forum for this, because it is not a programming issue, but here.

I’m an iOS app developer, and we have a third-party contract. They delivered us a massive PhotoShop file with all the separate works, made on separate layers, with double resolution. To get the cover art in Xcode, my workflow is as follows:

  • Show only layers containing a specific unit of artwork
  • Choose all
  • Copied copy
  • Create a new image (fortunately, the dimensions will take care automatically)
  • Embed
  • Deselect the overlay and remove the background to maintain transparency.
  • Save image as x.psd
  • Save copy as x@2x.png
  • Set image size to 50% of its original size
  • Save copy as x.png
  • cancel changes

This application is quite large, so it’s rather tedious to do this process for every small image. I am not very good at Photoshop, so I wonder if there is a better way. It seems to me that just combining steps 3-11 into one macro or script or something else is enough. The only thing that changes in each iteration of these steps is the name of the output. Any suggestions?

+8
ios graphics photoshop photoshop-script
source share
2 answers

You can script Photoshop with Javascript, and I wrote scripts in the past to follow a similar sequence of steps, it wasn't too hard to figure out even with a person like me who had never written Javascript before. Photoshop also has “Actions” that look like macros, and you can probably do something simple with this action, but that’s not what I personally tried. Check out Adobe's Photshop: Adobe Photoshop Scripting docs.

+2
source share

A normal workflow is exactly the same as you described. You can write a Photoshop script to export the layers, and Apple provides the Automator tool that allows you to resize these graphics from 2x to 50%. Great tutorial here . This will help you quickly scale your graphics.

There are solutions to automate what you are trying to accomplish. This video tutorial allows you to shoot PSD or PNG and transfer it to Xcode with all the layers correctly placed in the view for you, create view controllers and segments.

Disclaimer - I am associated with the JUMPSTART platform as indicated in the video.

+4
source share

All Articles