Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

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.

share|improve this question

5 Answers 5

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.

share|improve this answer
    
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 Aug 13 '13 at 18:17

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.

share|improve this answer
up vote 0 down vote accepted

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

share|improve this answer

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.

share|improve this answer
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 Aug 23 '13 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. –  Johannes Aug 23 '13 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. :) –  Ferdi Çıldız Aug 23 '13 at 19:06
    
I've changed the link. File uploaded on dropbox. –  Ferdi Çıldız Aug 24 '13 at 3:18

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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