3 Replies Latest reply on Dec 12, 2011 6:27 PM by dgolberg

    combine three images into one but...

    genis2011

      need to combine three images into one.

      But doing it automatically as the process must be applied using three sets of images, ie:

       

      A000+ B000+ C000   =   Z000

      A001+ B001+ C001   =   Z001

      .

      .

      .

      There is some action or perhaps created using Bridge?

      thanks

        • 1. Re: combine three images into one but...
          c.pfaffenbichler Level 9

          How exactly are they to be combined?

          Just load all three files as Layers on top of each other or in another arrangement?

           

          Are the files all located in the same Folder?

          Which formats are they saved as and which format should the resulting file be saved as?

          Are their names defintely identical save for the three digit number?

          • 2. Re: combine three images into one but...
            genis2011 Level 1

            we could locate the files in the same folder or in one folder for every set, that's no problem.

             

            The original format of all images is TGA, and the final format it would be the same.

             

            we can change the name of every serie, for example:

                 serie 1:  A000 / A001 / A002....

                 serie 2:  B000 / B001 / B002...

                 serie 3:  C000 / C001 / C002...

             

            They must be combined:

            The layer on top is black and white and the opacity is multiply

            The layer on middle has the opacity in 50% of transparency.

            The bottom layer has no changes.

             

            thanks

            • 3. Re: combine three images into one but...
              dgolberg Level 1

              Hey genis2011,

               

              Here's a script I came up with that should get the job done.  It's a bit messy, but it works on my end.  Let me know if you have any issues with it. 

               

              To use it, have your files named like you have them in your above reply (ie: A000.tga / A001.tga / A002.tga).  Also, it's currently setup to grab the files all from the same directory, but if you wish to change this, I've added comments to the lines you can change to make it grab these from specific sub-folders (so you could have your main file, the one opened by an automation, in your main folder, then create a sub-folder for the opacity layer and a different folder for the multiply layer if you wish).

               

              #target photoshop

               

              var myDoc = app.activeDocument;

              var projectName = app.activeDocument.name;

              var projectPath = app.activeDocument.path;

               

              var originalRulerUnits = app.preferences.rulerUnits;

              app.preferences.rulerUnits = Units.PIXELS;

               

              var num = 0;

              var finished = 0;

               

              for (i=97;i<=122;i++) {

                  var letter = String.fromCharCode(i);

                  var letter2 = letter.toUpperCase();

               

                  for (e=0;e<=100;e++) {       

                      e = e;

                      numberCheck();

                      var targetName = letter2 + num + ".tga";

                      if (targetName == projectName) {

                          e = e + 1;

                          num = e;

                          numberCheck();

               

                          targetName = letter2 + num + ".tga";

                          var projectPath1 = new File(projectPath + "/" + targetName); //Change the "/" if your 50% opacity layer's file is in a sub-folder (ie: change "/" to "/50Opacity/")

                          var myDoc1 = app.open(projectPath1);

               

                              app.activeDocument = myDoc1;

                              var newLayer = myDoc1.layers.getByName("Background")

                              var copiedLayer = newLayer.duplicate(myDoc, ElementPlacement.PLACEATBEGINNING);

                              app.activeDocument = myDoc;

                              app.activeDocument.activeLayer.opacity = 50;

                              copiedLayer.name = "50% Opacity";

               

                          e = e + 1;

                          num = e;

                          numberCheck();

                          targetName = letter2 + num + ".tga";

                          var projectPath2 = new File(projectPath + "/" + targetName); //Change the "/" if your Multiply layer's file is in a sub-folder (ie: change "/" to "/Multiply/").

                          var myDoc2 = app.open(projectPath2);

               

                              app.activeDocument = myDoc2;

                              var newLayer = myDoc2.layers.getByName("Background")

                              copiedLayer = newLayer.duplicate(myDoc, ElementPlacement.PLACEATBEGINNING);

                              app.activeDocument = myDoc;

                              app.activeDocument.activeLayer.blendMode = BlendMode.MULTIPLY;

                              copiedLayer.name = "Multiply";

               

                          finished = 1;

                              myDoc1.close(SaveOptions.DONOTSAVECHANGES);

                              myDoc2.close(SaveOptions.DONOTSAVECHANGES);

                      }

                      if (finished == 1) { break; }

                  }

                  if (finished == 1) { break; }

              }

               

              function numberCheck() {       

                  if (num >= 100) { num = e; }   

                  if (num >= 10 && num <= 99) { num = "0" + e; }

                  if (num <= 9) { num = "00" + e; }

              }   

               

              app.rulerUnits = originalRulerUnits;

              If you run into any issues or need help changing anything, let me know.  Hope this helps!

               

              Note: This action is setup to be run through automations as well, so I recommend placing your sub-layers in to a corresponding folder, then pointing the script to those folders for easier automation; otherwise it will try to do the same process for additional layers as well and likely error out.

               

              Edit: if you would rather use the A001.tga = main, B001.tga = sub layer 1, and C001.tga = sub layer 2 naming, let me know and I can modify it to do that too.