#target photoshop var runphotomergeFromScript = true; // must be before Photomerge include //@includepath "/Applications/Adobe Photoshop CS5/Presets/Scripts/" //@include "Photomerge.jsx" //@show include var inputFolder = Folder.selectDialog("Choose the folder containing the folders with the images to merge:"); var foldersToMerge = inputFolder.getFiles( function( file ) { return file instanceof Folder; } ); // If you want to safe the photomerge output to a user defined location, uncoment the line below. //var outputFolder = Folder.selectDialog("Choose the folder where you want to save the merged images:"); for( var i = 0; i < foldersToMerge.length; i++ ) { var activeFolder= foldersToMerge[i]; var fileList = activeFolder.getFiles( '*.tif' ); // 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 = false; // Geometric Distortion Correction'checkbox in dialog photomerge.removeVignette = false; // 'Vignette Removal' checkbox in dialog if( fileList.length > 1 ){ photomerge.createPanorama(fileList,false); var tiffSaveOptions = new TiffSaveOptions(); //tiffSaveOptions.embedColorProfile = true; tiffSaveOptions.imageCompression = TIFFEncoding.TIFFLZW; //tiffSaveOptions.imageCompression = TIFFEncoding.NONE; if (typeof outputFolder == "undefined") { activeDocument.saveAs( new File( activeFolder + '.tif' ), tiffSaveOptions, ); } else { activeDocument.saveAs( new File( outputFolder + '/' + activeFolder.name + '.tif' ), tiffSaveOptions, ); } activeDocument.close( SaveOptions.DONOTSAVECHANGES ); } };
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)