Skip navigation
Currently Being Moderated

Batch processing layers

Nov 30, 2012 5:53 PM

Tags: #photoshop_elements_11

Hi,

 

I am making some cinemagraphs and have many layers (frame captures) that I need to edit. I'd like to make the same lighting and color adjustment on each layer. Unless I am missing something, this can be a laboriuous task, involving repeatedly making the same adjustments to each layer in turn. Is there an easier way?

 

Thanks in advance for any help that can be offered.

 

I am using:

 

Photoshop Elements 11

Windows 7 Home Premium

 
Replies
  • Currently Being Moderated
    Nov 30, 2012 7:09 PM   in reply to RaydioRay1

    Sorry but I couldn't understand what you meant by "many layers (frame captures) ", If you have different layers in same document, you can always use actions or script to adjust your each layer with the settings you want.

    If you have different image documents on which you want to apply the same settings, you can use Process multiple files( from File> Process multiple Files). Please note that from Process multiple file, you can only choose to apply auto corrections

    For rest other cases, you are left with no choice but to write a script. You can find people ready to help you for writing the script on the forum if you could explain them your needs

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 2, 2012 1:48 AM   in reply to RaydioRay1

    Even though you can run scripts from PSE, it doesn't provide support for writing scripts. You would have to find documentation from Photoshop about writing script. In addition to it, you would need ExtendScript Tool Kit for debugging your script, which comes with Photoshop. So, I would advice you that instead of learning scripting you should look for some existing script that serves your purpose with minor modifications.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 2, 2012 2:21 AM   in reply to RaydioRay1

    I am posting a simplest script for adjusting all the layers in the active document with brightness 30 and contrast 40. Please copy the text betwen the line "script start" and "script end" to notepad and rename it as "script.jsx" (please make sure that the file is saved with extension .jsx and not .txt). To run the script, open your image document with multiple layers and then go to File>open and choose the file script.jsx and click open

    ---------------------script start-----------------------------

    #target pseeditor

    //Author: Domnic.rj23

    var docRef=app.activeDocument;

    var layerlength=docRef.artLayers.length;

    var layerRef=null;

    for(i=0;i<layerlength;i++){

        layerRef=docRef.artLayers[i];

        layerRef.adjustBrightnessContrast(30,40); //  brightness = [-100..100] and contrast =[-100..100].

        //layerRef.adjustColorBalance(); // [shadows][, midtones][, highlights][, preserveLuminosity]   For shadows, midtones, and highlights, the array must include three values in the range [-100..100],for CMYK/RGB

        //layerRef.adjustLevels(inputRangeStart,inputRangeEnd,inputRangeGamma ,outputRangeStart,outputRangeEnd);

        }

    ---------------------script end-----------------------------

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 5, 2012 10:13 PM   in reply to RaydioRay1

    Glad to be of help.

    Happy Editing

     

    ./Domnic

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 8, 2012 12:23 AM   in reply to RaydioRay1

    Hi Ray,

    Sorry about not checking the results of the script before giving out to you. There indeed is a difference between the results. So I tried looking to the bottom of this thing and found that Photoshop has made changes to its code that was used for adjusting brightness and contrast in the image. In Photoshop, both the codes are available for use from a checkbox "Use Legacy".But in PSE, only the newer code is available for use The function I called actually uses the legacy adjustment and thus has the range of [-100,100] for brightness and contrast. With newer code, the range has changed to [-150,150] for brightness and [-50,100] for contrast.

    I thus modified the code to include a recorded function from Photoshop and now it looks like this

    ---------------------script start-----------------------------

    #target pseeditor

    //Author: Domnic.rj23

    main=function(brightness,contrast){

    var docRef=app.activeDocument;

    var layerlength=docRef.artLayers.length;

    var layerName=null;

    for(i=0;i<layerlength;i++){

        layerName=docRef.artLayers[i].name;

        selectLayer(layerName);

        adjustBrightnessContrast(brightness,contrast);

        }

    }

    selectLayer=function(layerName){

    var idslct = charIDToTypeID( "slct" );

        var desc3 = new ActionDescriptor();

        var idnull = charIDToTypeID( "null" );

            var ref1 = new ActionReference();

            var idLyr = charIDToTypeID( "Lyr " );

            ref1.putName( idLyr, layerName);

        desc3.putReference( idnull, ref1 );

        var idMkVs = charIDToTypeID( "MkVs" );

        desc3.putBoolean( idMkVs, false );

    executeAction( idslct, desc3, DialogModes.NO );   

    }

       

    adjustBrightnessContrast=function (brightness,contrast){

    var idBrgC = charIDToTypeID( "BrgC" );

        var desc2 = new ActionDescriptor();

        var idBrgh = charIDToTypeID( "Brgh" );

        desc2.putInteger( idBrgh, brightness );

        var idCntr = charIDToTypeID( "Cntr" );

        desc2.putInteger( idCntr, contrast );

        var iduseLegacy = stringIDToTypeID( "useLegacy" );

        desc2.putBoolean( iduseLegacy, false );

    executeAction( idBrgC, desc2, DialogModes.NO );

    }

     

    main(40,30); // main (brightness,contrast)

     

    ---------------------script end-----------------------------

     

    The functions used in the scripts were recorded from Photoshop and should be replaced later by more reliable inbuild functions. But I believe it would solve the issue you were facing and would work well fine with large documents ( you may see a little flicker when the script runs. It may get significant if the large documents are used)

     

     

    P.S. The text after "//" till the end of line are comments and they have no role in code. I thus have reduced comments so that the code remains more cleaned up

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 10, 2012 5:57 AM   in reply to RaydioRay1

    Hi Ray,

    Glad to here the script is working fine for you.

    Here is the script for adjusting your brightness/contrast along with hue/saturation/lightness. For sharpness, I need to know what kind of sharpness do you use. I mean out of Adjust Sharpness, unsharpmask or Auto sharpen.

    If you want to learn how to make your own recorded scripts, do let me know

     

    ---------------------script start-----------------------------

     

    #target pseeditor

    //Author: Domnic.rj23

    main=function(){

    var docRef=app.activeDocument;

    var layerlength=docRef.artLayers.length;

    var layerName=null;

    for(i=0;i<layerlength;i++){

        layerName=docRef.artLayers[i].name;

        selectLayer(layerName);

        adjustBrightnessContrast(0,0);//input brightness and contrast values. ex: 30,40

              adjustHueSaturationLightness(44,0,0); //input Hue, Saturation, lightness values. ex: 40,0,0

        }

    }

    selectLayer=function(layerName){

    var idslct = charIDToTypeID( "slct" );

        var desc3 = new ActionDescriptor();

        var idnull = charIDToTypeID( "null" );

            var ref1 = new ActionReference();

            var idLyr = charIDToTypeID( "Lyr " );

            ref1.putName( idLyr, layerName);

        desc3.putReference( idnull, ref1 );

        var idMkVs = charIDToTypeID( "MkVs" );

        desc3.putBoolean( idMkVs, false );

    executeAction( idslct, desc3, DialogModes.NO );  

    }

      

    adjustBrightnessContrast=function (brightness,contrast){

    var idBrgC = charIDToTypeID( "BrgC" );

        var desc2 = new ActionDescriptor();

        var idBrgh = charIDToTypeID( "Brgh" );

        desc2.putInteger( idBrgh, brightness );

        var idCntr = charIDToTypeID( "Cntr" );

        desc2.putInteger( idCntr, contrast );

        var iduseLegacy = stringIDToTypeID( "useLegacy" );

        desc2.putBoolean( iduseLegacy, false );

    executeAction( idBrgC, desc2, DialogModes.NO );

    }

     

     

    adjustHueSaturationLightness=function(Hue,Saturation,Lightness){

    var idHStr = charIDToTypeID( "HStr" );

        var desc2 = new ActionDescriptor();

        var idpresetKind = stringIDToTypeID( "presetKind" );

        var idpresetKindType = stringIDToTypeID( "presetKindType" );

        var idpresetKindCustom = stringIDToTypeID( "presetKindCustom" );

        desc2.putEnumerated( idpresetKind, idpresetKindType, idpresetKindCustom );

        var idClrz = charIDToTypeID( "Clrz" );

        desc2.putBoolean( idClrz, false );

        var idAdjs = charIDToTypeID( "Adjs" );

            var list1 = new ActionList();

                var desc3 = new ActionDescriptor();

                var idH = charIDToTypeID( "H   " );

                desc3.putInteger( idH, Hue );

                var idStrt = charIDToTypeID( "Strt" );

                desc3.putInteger( idStrt,Saturation );

                var idLght = charIDToTypeID( "Lght" );

                desc3.putInteger( idLght, Lightness );

            var idHsttwo = charIDToTypeID( "Hst2" );

            list1.putObject( idHsttwo, desc3 );

        desc2.putList( idAdjs, list1 );

    executeAction( idHStr, desc2, DialogModes.NO );

    }

    main();

    ---------------------script end-----------------------------

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points