: Export photoshop layers programatically to individual pngs of different sizes Hi there I'm trying to export all of the layers in my .psd to .pngs/.jpegs and I am having trouble exporting them
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.
More posts by @Caterina889
5 Comments
Sorted by latest first Latest Oldest Best
Have you considered using Generator and writing something to export assets programatically? 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.
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.
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
Have you heard of 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.
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.