Mobile app version of vmapp.org
Login or Join
Radia289

: Export a PSD to compressed and transparent TIF files with only one layer I have several packshot images inside a group (with a mask to have a transparent background) and a shadow layer at

@Radia289

Posted in: #AdobePhotoshop #Export #FileSize #Layers

I have several packshot images inside a group (with a mask to have a transparent background) and a shadow layer at the bottom.

Is there any way to export all images in TIF files with only one layer and transparency?

I tried with Layer Comps but I have every layers in each file, so that's about 500mb for each (instead of ~15mb).

I have the CC 2015 version.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Radia289

1 Comments

Sorted by latest first Latest Oldest Best

 

@Nimeshi706

I've written a script, which copies the layer mask of the selected group to all layers in the group itself. Use Export Layers to Files script afterwards in order to export your layers to the desired file type (shipped with photoshop by default).




Backup your photoshop file first
Select the group/folder in the layer stack
Select and run the script via File > Scripts > Browse


Copy-groupMask-to-groupLayers.jsx
#target Photoshop

// pass the layer name
function copy_mask(targetLayer) {

$.writeln(targetLayer);

var desc126 = new ActionDescriptor();
desc126.putClass( charIDToTypeID('Nw '), charIDToTypeID('Chnl') );

var ref111 = new ActionReference();
ref111.putEnumerated( charIDToTypeID('Chnl'), charIDToTypeID('Chnl'), charIDToTypeID('Msk ') );
ref111.putName( charIDToTypeID('Lyr '), targetLayer.toString() );
desc126.putReference( charIDToTypeID('At '), ref111 );

var ref112 = new ActionReference();
ref112.putEnumerated( charIDToTypeID('Chnl'), charIDToTypeID('Chnl'), charIDToTypeID('Msk ') );
ref112.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
desc126.putReference( charIDToTypeID('Usng'), ref112 );
desc126.putBoolean( charIDToTypeID('Dplc'), true );

executeAction( charIDToTypeID('Mk '), desc126, DialogModes.NO );
};

// get the document
var doc = app.activeDocument;

// get the selection
var group = doc.activeLayer;

// iterate through the layers and copy the mask
for (var i=0; i<group.layers.length; i++){
copy_mask(group.layers[i].name);
}

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme