Skip to main content
mirza5313
Known Participant
February 23, 2016
Question

Photoshop Imaegmerge script

  • February 23, 2016
  • 2 replies
  • 512 views

I need to do this on Photoshop cs6, I have many folders named like "770_1" , "770_2" , "771_1", etc.

Each folder has 5-15 pictures inside which need to be merged using automerge on Photoshop. The images inside each folder are automerged, and a file named "770_1_merged" , "770_2_merge" etc is created and placed in a folder named "merged_photos".

The photos are either .TIF or .JPG extension Does that sound doable?

This topic has been closed for replies.

2 replies

c.pfaffenbichler
Community Expert
Community Expert
February 28, 2016

// 2016, use it at your own risk;

#target photoshop

var runphotomergeFromScript = true; // must be before Photomerge include

//@includepath "/Applications/Adobe Photoshop CC 2015/Presets/Scripts/"

//@include "Photomerge.jsx"

//@show include

var psdOpts = new PhotoshopSaveOptions();

psdOpts.embedColorProfile = true;

psdOpts.alphaChannels = true;

psdOpts.layers = true;

var theFolder = Folder(/*insert the folder path here*/);

var files = theFolder.getFiles(/\.(jpg|tif)$/i);

mergeImages(files, psdOpts);

////// perform photomerge //////

function mergeImages(fList, psdOpts) {

   // override Photomerge.jsx settings. Default is "Auto". Uncomment to override the default.

   photomerge.alignmentKey   = "Auto";

   //photomerge.alignmentKey   = "Prsp";

   //photomerge.alignmentKey   = "cylindrical";

   //photomerge.alignmentKey   = "spherical";

   //photomerge.alignmentKey   = "sceneCollage";

   //photomerge.alignmentKey   = "translation"; // "Reposition" in layout dialog

   // other setting that may need to be changed. Defaults below

   photomerge.advancedBlending      = true; // 'Bend Images Together' checkbox in dialog

   photomerge.lensCorrection      = true; // Geometric Distortion Correction'checkbox in dialog

   photomerge.removeVignette      = true; // 'Vignette Removal' checkbox in dialog

   if( fList.length >  0) {

      photomerge.createPanorama(fList,false);

   }

   // The merged doc will be the activeDocument

   activeDocument.saveAs( new File( fList[0].parent.path+"/pano_"+activeDocument.layers[0].name.match(/(.*)\.[^\.]+$/)[1] + ".psd" ) , psdOpts, false, Extension.LOWERCASE);

};

c.pfaffenbichler
Community Expert
Community Expert
February 27, 2016

What is giving you problems?

Have you done a Forum search yet?

mirza5313
mirza5313Author
Known Participant
February 27, 2016

Yeh i have searched several time but have not fond any solution yet. I just want simple photomerge js code, rename can be done by image batch process just need js for image auto merge code...

c.pfaffenbichler
Community Expert
Community Expert
February 28, 2016