Export layers to PNG files, with their layer sizes with Photoshop
Exporting layers in Photoshop
I have a psd file with 30-40 layers.
I would like to export these into PNG files, since I need the transparent background.
I have tried some scripts out there and the
Export... (which outputs only in jpeg), but the results are not how I would like.
I want it to export each layer using just that layer's visible height+width for the PNG output.
When I export a website PSD to PNG file, the logo PNG image size should be like 80x80px, and not the big 1200x800 (which is full website/size of the psd) where it hides the rest and leaves big white/transparent pixels.
See the image under, this is NOT how I wish it:
I only want the layer itself, which is the pink colored text, to be in the output png file.
Hope you understand what I am looking for to do.
This is pretty easy in Photoshop.
Youâ€™ll need your file to be set up so that each layer equals one file youâ€™d like to export. If you have groups that you want exported, youâ€™ll have to merge them to one layer (pressing command-E will do this).
Once youâ€™re set up, run File â†’ Scripts â†’ Export Layers to Files, choose the PNG file type (if thatâ€™s what you want) and ensure Trim Layers is turned on.
If youâ€™d like some images to be PNG and some to be other formats, then you could save them all as PNG24 and convert the images you'd like changed after (this can be done as one or more batch operations in Photoshop or another app). Or, you could just run the script several times, with a different destination folder, then delete the files you donâ€™t need. Both effective and quick, without much manual work.
Unless you specifically need it, I'd turn ICC profiles off. Generally speaking, ICC profiles are a bad idea for interface graphics (but can be a good idea for photographs, depending on the situation).
You may want Transparency on, depending on your requirements.
Thereâ€™s other great ways to automate exporting from Photoshop. I really like using sprite sheets with slices. It means you can set things up so exporting an entire project is a job that takes less than a minute.