Skip to main content
nickg2021
Participating Frequently
December 1, 2009
Question

How do I script a PNG24 file to have white opaque background

  • December 1, 2009
  • 1 reply
  • 1595 views

I have a script that will export layers to png files but I want each layer to have a white background and not a transparent background

I am using these sets of export options.

var exportOptions = new ExportOptionsPNG24();

exportOptions.antiAliasing = true;

exportOptions.matte = true;

exportOptions.matteColor = RGBColorobject;

exportOptions.transparency = false;

I know I am using the exportOptions.matteColor = RGBColorobject; incorrectly but need some direction on how to get this to work.

even when I delete that line and have the transparency set to false and the matte = true I still get a transparent background.
Any coaching will be appreciated.

This topic has been closed for replies.

1 reply

Larry G. Schneider
Community Expert
Community Expert
December 1, 2009

Delete the matte color line and try setting artBoardClipping to true.

nickg2021
nickg2021Author
Participating Frequently
December 1, 2009

Thanks for responding Larry,

I did that and when I open the png file in photoshop it still has a transparent background.

usually transparent backgrounds would be great but I need to isolate some patterns to be used on a 3D model in PS CS4

All the references I see say to just mark transparency as false…

Nick

Larry G. Schneider
Community Expert
Community Expert
December 1, 2009

I probably have the same script and it works with the transparency set to false for me. Post the whole script and let's see.