Skip to main content
New Participant
January 17, 2024
Answered

Script for saving transparent PNG with a specific dimension

  • January 17, 2024
  • 2 replies
  • 887 views

Been trying to figure this out on my own but I couldn't so here we go...

Basically, I need a script that turns off or removes the "ORIG" Group and the white fill layer (highlighted in red). Then export as transparent PNG with 1620 x 2000 pixel dimensions (vertical). All the images have a 1:1/square ratio. I do a lot of these images and I've been exporting and cropping the PNGs by hand. Any help is greatly appreciated.

 

This topic has been closed for replies.
Correct answer Stephen Marsh

Do all docs use consistent layer names? If so, an action and batch processing should be able to do this.

 

Consistent quantities of layers/sets, stacking order etc would also be useful if names were not consistent.

 

A layered sample file would save those offering help the need to build a test file. An example final file is also helpful to clearly communicate the desired outcome.

 

EDIT: Something like the following recorded into an action –

 

* OPT/ALT click the eyeball of the RT or RT copy layer in the layer panel.

 

* Image > Trim: Transparent pixels

 

* Image Size or Fit Image commands to 2000px high 

 

* Image > Canvas Size: 1620 x 2000

 

* Legacy Save As/Save a Copy or Export > Save for Web to transparent PNG

 

* Close without saving the layered PSD as the changes made are only intended to be temporary 

2 replies

Stephen Marsh
Community Expert
January 19, 2024

@Walkurie – so where are you at?

WalkurieAuthor
New Participant
January 22, 2024

Sorry for the late reply but yeah, making an action seems to work. I don't know why I didn't think of that before. Thanks!

Stephen Marsh
Community Expert
January 22, 2024

You're welcome! Sometimes it's not obvious if you can automate the process with an action until you try. Sometimes it is possible, otherwise a script may be necessary.

Stephen Marsh
Stephen MarshCorrect answer
Community Expert
January 17, 2024

Do all docs use consistent layer names? If so, an action and batch processing should be able to do this.

 

Consistent quantities of layers/sets, stacking order etc would also be useful if names were not consistent.

 

A layered sample file would save those offering help the need to build a test file. An example final file is also helpful to clearly communicate the desired outcome.

 

EDIT: Something like the following recorded into an action –

 

* OPT/ALT click the eyeball of the RT or RT copy layer in the layer panel.

 

* Image > Trim: Transparent pixels

 

* Image Size or Fit Image commands to 2000px high 

 

* Image > Canvas Size: 1620 x 2000

 

* Legacy Save As/Save a Copy or Export > Save for Web to transparent PNG

 

* Close without saving the layered PSD as the changes made are only intended to be temporary