Skip to main content
Participant
December 13, 2017
Resuelto

Merging an Adjustment layer to many layers.

  • December 13, 2017
  • 5 respuestas
  • 9119 visualizaciones

Hello, I believe after 20 years of photoshop, someone must have implemented this feature since it is very frustrating working without it.

I have an Adjustment Layer.
Below it, I have 50 Layers.
I WANT SPECIFICALLY  MERGE the adjustment layer to  EACH OF all the below 50 layers.
I DON'T want merge all the layers.
I DON'T WANT to group the layers and have the adjustment layer there.

What I would do now is to duplicate the Adjustment layers 50 times and click for each couple (Adjustment layer-Picture Layer), Merge Layers.

This is unfeasible and very frustrating.
I have heard about strange things with smart objects or batch, ALL INCOMPLETE solutions. THIS is a DAILY PROBLEM of millions artists.
PLEASE provide STEP BY STEP solutions!!
Thank you very much!!

Este tema ha sido cerrado para respuestas.
Mejor respuesta de Chuck Uebele

Try this script. You have to have the adjustment layer selected when you run the script! It will not merge with a smart object nor a group (layer set). It will only merge with layers that are below it, and that are in the same "group" such as the top level of the file, or in a layer set.

#target photoshop

var doc = activeDocument;

var adjL = doc.activeLayer

for(var i = adjL.parent.layers.length-1;i>0;i--){

    doc.activeLayer = adjL.parent.layers;

    var nextL = doc.activeLayer

    if(nextL.name == adjL.name){break;}

    if(nextL.typename !='LayerSet'){

        try{

            doc.activeLayer = adjL

            dupeL ();

            var tempL = doc.activeLayer

            tempL.move(nextL,ElementPlacement.PLACEBEFORE);

            mergeL ();

            }

        catch(e){

            tempL.remove()

            }

        }

   

    }

function mergeL(){

     var idMrgtwo = charIDToTypeID( "Mrg2" );

        var desc5 = new ActionDescriptor();

    executeAction( idMrgtwo, desc5, DialogModes.NO );  

    }

function dupeL(){

    var idCpTL = charIDToTypeID( "CpTL" );

        executeAction( idCpTL, undefined, DialogModes.NO );

    }

5 respuestas

Earth Oliver
Legend
July 1, 2022

For anyone who needs this workflow, there's a free tool called Layers to Files (Fast) that can automate this and a few other essential workflows. Just add your adj layer on top, then choose Top Layer as Foreground.
https://github.com/antipalindrome/Photoshop-Export-Layers-to-Files-Fast
https://github.com/antipalindrome/Photoshop-Export-Layers-to-Files-Fast/releases/tag/v2.6.0

Participant
February 27, 2024

Thank You!

I know little to nothing about scripts, but this worked prferctly for me.

Participant
July 1, 2022

HOW DO I CREATE A SCRIPT FILE FOR THIS CODE ? I AM GETTIN

 

Error 1200 IN THIS LINE doc.activeLayer = adjL.parent.layers;

Tom Winkelmann
Inspiring
July 1, 2022

Replace...

    doc.activeLayer = adjL.parent.layers;

...with...

    doc.activeLayer = adjL.parent.layers[i];

 

Be sure you have selected the adjustment layer when running the script

Participant
July 1, 2022

Thanks!!!!!!

Chuck Uebele
Community Expert
Community Expert
December 14, 2017

If you still want to do it manually, you can copy the adjustment layer, then use alt/opt-[ to go down to the next layer, ctrl/cmd-V to paste the adjustment layer, then ctrl/cmd-E to merge it down. It saves the step of duplicating the adjustment layer and moving it.

Kukurykus
Legend
February 16, 2018
If you still want to do it manually, you can copy the adjustment layer (...) to paste the adjustment layer

I tried actually next step so alt and [ but did mistake and pressed alt with one of arrow keys. It was the same I duplicated adjustment layer (though I checked my shortcuts and this one wasn't listed, also in layers dropdown menu). So if anyone wants to do it manually it can be done this way (alt & [ between) instead of choosing copy and then paste certain layer

Legend
February 16, 2018

I did it with other blend mode & changed opacity and it worked the way if I used menu options, so what do you mean then?


Kukurykus  написал(а)

I did it with other blend mode & changed opacity and it worked the way if I used menu options, so what do you mean then?

A file of four layers. The bottom is filled completely. The next two are small disjoint squares. The top layer is Levels.

Option 1:

Bottom layer fill 194 194 194, opacity 100, Normal Mode

next small square layer fill 100 100 100, opacity 100, Screen Mode

next small square layer fill 100 100 100, opacity 100, Normal Mode

Top layer Levels inp(0 1 207)  out(0 255)

Option 2:

Bottom layer fill 0 0 0, opacity 100, Normal Mode

next small square layer fill 100 100 100, opacity 50, Normal Mode

next small square layer fill 100 100 100, opacity 100, Normal Mode

Top layer Levels inp(0 1 255)  out(105 255)

Check )

chanaart
Community Expert
Community Expert
December 14, 2017

Can you send the demo file and explain so I can re do it and see how to make it happen?

chana

Chuck Uebele
Community Expert
Chuck UebeleCommunity ExpertRespuesta
Community Expert
December 14, 2017

Try this script. You have to have the adjustment layer selected when you run the script! It will not merge with a smart object nor a group (layer set). It will only merge with layers that are below it, and that are in the same "group" such as the top level of the file, or in a layer set.

#target photoshop

var doc = activeDocument;

var adjL = doc.activeLayer

for(var i = adjL.parent.layers.length-1;i>0;i--){

    doc.activeLayer = adjL.parent.layers;

    var nextL = doc.activeLayer

    if(nextL.name == adjL.name){break;}

    if(nextL.typename !='LayerSet'){

        try{

            doc.activeLayer = adjL

            dupeL ();

            var tempL = doc.activeLayer

            tempL.move(nextL,ElementPlacement.PLACEBEFORE);

            mergeL ();

            }

        catch(e){

            tempL.remove()

            }

        }

   

    }

function mergeL(){

     var idMrgtwo = charIDToTypeID( "Mrg2" );

        var desc5 = new ActionDescriptor();

    executeAction( idMrgtwo, desc5, DialogModes.NO );  

    }

function dupeL(){

    var idCpTL = charIDToTypeID( "CpTL" );

        executeAction( idCpTL, undefined, DialogModes.NO );

    }

renatot34194169
Participant
May 11, 2023

This is grate!

We noticed a little correction needed at line 5.
doc.activeLayer = adjL.parent.layers[i];

Thanks again for the solution!