2

Hi there I'm trying to export all of the layers in my .psd to .pngs/.jpegs and I am having trouble exporting them so that the sizes of the individual .pngs are the size of the image they contain.

I have seen this thread which has a script that almost does this but since I'm a new user here I can't comment on it...if the creator of that script (Johannes) could respond i would be very grateful.

0

5 Answers 5

1

Have you heard of http://macrabbit.com/slicy/? I started using this and it makes it extremely easy to export all layers as .png or .jpg. with one click. From what I remember it makes the .png the same size as the image it contains. Might be worth looking into. It's made life easier for me.

0
0

You can create an Action to do this if you have a lot of layers to save. Regardless, here's what you do:

  • Click on the layer in the layers palette and go under Layer > Duplicate Layer (you can also right click for this).
  • In the dialog box that pops up, look at the bottom where it says Destination and select "New" from the drop down menu. This duplicates the layer in a new document.
  • If the background of the new document is transparent, go to Image > Trim. Select transparent pixels and trim away top, bottom, left, right.

If the image had a background color, hide or delete that layer, then follow the step above. Then save the new document and then save for web.

1
  • Right now I have a script which does this but it's highly inefficient to create and close hundreds of new documents so I'm trying to find a more efficient way to do the same thing. Also I want to do this programatically not by hand
    – daveroz
    Commented Aug 13, 2013 at 18:17
0

I ended up using slicy. it works very well: just had to write a script to create the folders so that slicy can read the psd correctly

0

Use this script below to save each layer into files. When you save them in seperate files you can create an action which makes the Image -> Trim move to cut the layers transparent pixels which you don't need for every file.

You can download the script from here.

4
  • 1
    Chrome does not like that link: "The Website Ahead Contains Malware!" Could you paste the script into your answer? If you style it as pre-formatted text, scrollbars will be added to prevent it from being too long.
    – JohnB
    Commented Aug 23, 2013 at 18:10
  • 1
    Ferdi, it seems like you are posting a lot of scripts (which is great!) I would recommend though that you open a github account and just upload your scripts there. That way people look at the scripts, download them, and even ask to improve your scripts and contribute if they see a way to make it even better.
    – Hanna
    Commented Aug 23, 2013 at 18:33
  • Thanks. Actually I'm a web designer and I have a blog. And I'm posting useful tips about photoshop and design. So, these scripts are not written by me. If I learn one day, I'll have a github, too. :) Commented Aug 23, 2013 at 19:06
  • I've changed the link. File uploaded on dropbox. Commented Aug 24, 2013 at 3:18
0

Have you considered using Generator and writing something to export assets programatically? https://github.com/adobe-photoshop/generator-assets/wiki/Generate-Web-Assets-Functional-Spec

If you need a user interface, you can try out the Extract Assets dialog in the new version of Photoshop.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.