문제

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 x@2x.png
  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?

도움이 되었습니까?

해결책

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.

다른 팁

Normal workflow is exactly as you described. You can write a Photoshop script to do the layer exporting and Apple provides an Automator tool that will allow you to resize those graphics from 2x down 50%. Great tutorial here. This can help get your graphics to scale quickly.

There are solutions to automate what your trying to accomplish. This video tutorial allows you to take your PSD or PNG and port it into an Xcode with all of the layers properly placed in a view for you, create view controllers, and segues.

Disclaimer - I am associated with the JUMPSTART Platform as mentioned in the video.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top