I made a quick edit to a script that I had previously hacked together. A single source folder is selected and the script will then process pairs of files, stacking one over the other at 50% opacity, then save out a JPEG into a newly named folder within the source folder.
It is assumed that all file pairs have correct alphabetical pair names for sorting and that the total count of all files is divisible by 2.
#target photoshop
var restoreDialogMode = app.displayDialogs;
app.displayDialogs = DialogModes.NO;
main();
function main() {
inputFolder = Folder.selectDialog("Please select the folder with Files to process");
if (inputFolder === null) return;
var newPath = Folder(decodeURI(inputFolder + "/Combined")); // Create sub-dir
if (!newPath.exists) newPath.create();
var fileList = inputFolder.getFiles(/\.(jpg|jpeg|tif|tiff|png|psd)$/i); // Limit file format input
fileList.sort(); // Force alpha-numeric list sort
while (fileList.length) {
for (var a = 0; a < 2; a++) { // Digit 2 for two files
try {
app.open(fileList.pop());
} catch (e) { }
}
processFiles();
}
alert("Done!");
function processFiles() {
try {
var Name = app.documents[0].name.replace(/\.[^\.]+$/, ''); // Remove file extension
app.activeDocument = documents[1];
app.activeDocument.activeLayer.duplicate(documents[0]);
app.activeDocument = documents[0];
var doc = app.activeDocument;
doc.activeLayer.opacity = 50.0; // Layer opacity
doc.activeLayer.blendMode = BlendMode.NORMAL; // Blend mode
app.displayDialogs = restoreDialogMode;
} catch (e) { }
var saveFile = File(newPath + "/" + Name + "_Combined" + ".tif");
saveTIFF(saveFile);
while (app.documents.length) {
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
}
}
}
function saveTIFF(saveFile) {
tiffSaveOptions = new TiffSaveOptions();
tiffSaveOptions.embedColorProfile = true;
tiffSaveOptions.byteOrder = ByteOrder.IBM;
tiffSaveOptions.transparency = true;
tiffSaveOptions.layers = true;
tiffSaveOptions.layerCompression = LayerCompression.ZIP;
tiffSaveOptions.interleaveChannels = true;
tiffSaveOptions.alphaChannels = true;
tiffSaveOptions.annotations = true;
tiffSaveOptions.spotColors = true;
tiffSaveOptions.saveImagePyramid = false;
// NONE | JPEG | TIFFLZW | TIFFZIP
tiffSaveOptions.imageCompression = TIFFEncoding.TIFFLZW;
app.activeDocument.saveAs(saveFile, tiffSaveOptions, true, Extension.LOWERCASE);
}
The script can be modified to save out a TIFF if it otherwise performs as required... What TIFF save options are needed?
EDIT: I have updated the code with TIFF save options rather than JPEG.
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html