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.

  • Depending on how many layers there are, it might be easier to delete the layers manually. Just delete the layers you do not want included into the tif file with 1 showing and then export. Repeat for the other layers. Maybe you can do a data merge in Photoshop if the images are already separate.
    – AndrewH
    Jun 17, 2015 at 17:28
  • You are using a single mask for all layers? Do you want to export the groups as tiffs, right?
    – p2or
    Jun 17, 2015 at 17:52
  • @poor: I have only one group with a mask and all the images inside
    – flks
    Jun 17, 2015 at 21:01
  • Ok, if you are able to write javascript - there is a script called Export all Layers as Files. I'd try to modify it in order to apply the mask first and export the Layer afterwards.
    – p2or
    Jun 18, 2015 at 8:41
  • @poor: yep I know that script but the aim is to find an existing tool, as it's very specific I'll probably don't redo it
    – flks
    Jun 18, 2015 at 11:28

1 Answer 1


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).

enter image description here

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


#target Photoshop

// pass the layer name
function copy_mask(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++){

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.