What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Batch Automation Batch in order to create pairs of images


do_it

Member
Messages
9
Likes
0
I have a big problem here, i have several folders with hundreds of images that i need to join, 2 images in 1 image (back and front).

Is that possible (by action or script)?

First i need to auto crop & straighten images then create a new photoshop document with 2 images (top & bottom) with a small border.

(all of them have the same width 900px )

thank you very much
 

do_it

Member
Messages
9
Likes
0
Ups, my post disappeared :X

I will post again, I have several images that i have to join, 2 images in 1 image.
All of them have 900 px width and i need to paste back and front in a single image, like the example.
I have a square background with 1200x1200 and i need to auto crop and align a and then paste and align,
Is this possible?

best regards
 

colleague

Guru
Messages
824
Likes
1,254
is the 2th image a color-variation of the 1th
or is it a complete other image

how are the pairs located in a folder
do they have a name like "picture1 a" and "picture1 b"

maybe you can autocrop and center all images with background 1200px x 600 px
and after that combine the pairs to a new background 1200px x 1200 px
 

do_it

Member
Messages
9
Likes
0
is the 2th image a color-variation of the 1th
or is it a complete other image

how are the pairs located in a folder
do they have a name like "picture1 a" and "picture1 b"

maybe you can autocrop and center all images with background 1200px x 600 px
and after that combine the pairs to a new background 1200px x 1200 px


Thanks for your reply,

The second image is another image, like a bank note, with a front and back, and it will be like the example I posted before.

Their are on the same folder with diferent names, but it will be no problem, since i can separete and rename as I wish.

The final result, will be two images, one at the top and one at the bottom, with a black backgroud.

thanks in advance :)
 

do_it

Member
Messages
9
Likes
0
you need a script like paul rigott made in this link
http://forums.adobe.com/message/3823892#3823892
but it needs some adjustments

Thank you very much :)

Code:
#target photoshop
main();
function main(){
var inputFolder = Folder.selectDialog("Please select the folder with Files to process"); 
if(inputFolder == null) return;
var startRulerUnits = preferences.rulerUnits;
app.displayDialogs = DialogModes.NO;
var outputFolder = Folder(inputFolder + "/Combined");
if(!outputFolder.exists) outputFolder.create();
var fileList = inputFolder.getFiles(/.jpg$/i); 
while(fileList.length>0){
preferences.rulerUnits = Units.PIXELS;
if(fileList.length==1) break;
var mainDoc = open(fileList.shift());
mainDoc.resizeCanvas(mainDoc.width, [COLOR=#ff0000](mainDoc.height*2)[/COLOR], AnchorPosition.TOPLEFT);
var tmp = open(fileList.shift());
tmp.activeLayer.duplicate(mainDoc); 
tmp.close(SaveOptions.DONOTSAVECHANGES);
var LB = mainDoc.activeLayer.bounds;
mainDoc.activeLayer.translate((mainDoc.width-LB[2].value),0);
mainDoc.flatten();
preferences.rulerUnits = Units.PERCENT;
mainDoc.resizeImage(66.66666, undefined, undefined, ResampleMethod.BICUBICSHARPER);
var saveFile = File(outputFolder + "/" + decodeURI(activeDocument.name));
SaveJPEG(saveFile, 10);
mainDoc.close(SaveOptions.DONOTSAVECHANGES);
}
preferences.rulerUnits = startRulerUnits;
}
function SaveJPEG(saveFile, jpegQuality){
jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.embedColorProfile = true;
jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpgSaveOptions.matte = MatteType.NONE;
jpgSaveOptions.quality = jpegQuality; 
activeDocument.saveAs(saveFile, jpgSaveOptions, true,Extension.LOWERCASE);

I had already changed the height in order to double vertically, now I need some help in order to align the second image.

It will be AnchorPosition.BOTTOMLEFT but where can i put this part?

Thanks in advance :)
 

colleague

Guru
Messages
824
Likes
1,254
hoi do_it

this works fine if all images are 1200x600 to start with

#target photoshop
main();
function main(){
var inputFolder = Folder.selectDialog("Please select the folder with Files to process");
if(inputFolder == null) return;
var startRulerUnits = preferences.rulerUnits;
app.displayDialogs = DialogModes.NO;
var outputFolder = Folder(inputFolder + "/Combined");
if(!outputFolder.exists) outputFolder.create();
var fileList = inputFolder.getFiles(/.jpg$/i);
while(fileList.length>0){
preferences.rulerUnits = Units.PIXELS;
if(fileList.length==1) break;
var mainDoc = open(fileList.shift());
mainDoc.resizeCanvas((mainDoc.width), (mainDoc.height*2), AnchorPosition.TOPLEFT);
var tmp = open(fileList.shift());
tmp.activeLayer.duplicate(mainDoc);
tmp.close(SaveOptions.DONOTSAVECHANGES);
var LB = mainDoc.activeLayer.bounds;
mainDoc.activeLayer.translate((0),(300));
var saveFile = File(outputFolder + "/" + decodeURI(activeDocument.name));
SaveJPEG(saveFile, 10);
mainDoc.close(SaveOptions.DONOTSAVECHANGES);
}
preferences.rulerUnits = startRulerUnits;
}
function SaveJPEG(saveFile, jpegQuality){
jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.embedColorProfile = true;
jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpgSaveOptions.matte = MatteType.NONE;
jpgSaveOptions.quality = jpegQuality;
activeDocument.saveAs(saveFile, jpgSaveOptions, true,Extension.LOWERCASE);

}
 
Last edited:

Top