Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Create strip from image sequence

Participant ,
Oct 02, 2008 Oct 02, 2008
I need a script or action, or droplet or something that will take a folder of images and create One Image strip from it. Basically I have animations I have rendered out as frames that I need to put in a game. The game needs the images in one file with all the images side by side (or on top of each other I think) The frames are all one size (but different for each sequence) It takes about 4 hours for me to do this now. And then if it has to change it's four more hours...

Any thoughts idease or techniques?

C
TOPICS
Actions and scripting
21.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
New Here ,
Oct 02, 2008 Oct 02, 2008
The same do i, if anyone can help please
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Oct 02, 2008 Oct 02, 2008
Depending on what version of Photoshop you have, in PS-CS3 there is 'Files - Scripts - Load Files into Stack" that will create all the documents on top of each other. If you want them in a strip Left to Right something like this might work for you....



selectedFolder = Folder.selectDialog( "Please select input folder");

var fileList = selectedFolder.getFiles();

var strtRulerUnits = app.preferences.rulerUnits;

var strtTypeUnits = app.preferences.typeUnits;

app.preferences.rulerUnits = Units.PIXELS;

app.preferences.typeUnits = TypeUnits.PIXELS;

for(var a = 0; a<fileList.length;a++){

var file = fileList;

if(file instanceof File && file.name.match(/\.(jpg|tif|gif|png)$/i)){

open(file);

var Width = ...





















































Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 03, 2008 Oct 03, 2008
So a solution was posted in the PS forum where I also posted the question....

Silkrooster - 4:04pm Oct 2, 08 PST (#3 of 3)

I would think contact sheet II would work just set the columns to the number of sequence images and set rows to 1. Then make the width of the page wide enough to fit the entire row or images. The longer your sequence is the longer it will take to generate your storyboard.

This worked like a charm! Thanks everyone!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 03, 2009 Feb 03, 2009
I am working on a script to create a stack of images similar to what you did here but I would like to stack the images ontop of each other instead of side by side like you have here... How would I modify this script to let me stack the images on top of one another.

Thanks!
Ben
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 03, 2009 Feb 03, 2009
Ben,

The contact sheet II feature in CS3 will do that as well!

C
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 04, 2009 Feb 04, 2009
Unfortunately I need it to be able to process 1000 pictures or more and the contact sheet II feature does not support that number of images and it is bulky for what I'm looking for.

The script that Paul R wrote worked perfectly for stacking the images side by side, I even added a feature that flattens the layers so that it completes much faster and can process a huge number of images.

Perhaps I'm incorrect but I don't believe it would be that difficult to modify Paul's script to stack images ontop of one another instead of side by side, I just don't know how to go about doing so.

Any help would be greatly appreciated!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Feb 04, 2009 Feb 04, 2009
This should stack them on top of each other...


selectedFolder = Folder.selectDialog( "Please select input folder");

var fileList = selectedFolder.getFiles();

var strtRulerUnits = app.preferences.rulerUnits;

var strtTypeUnits = app.preferences.typeUnits;

app.preferences.rulerUnits = Units.PIXELS;

app.preferences.typeUnits = TypeUnits.PIXELS;

for(var a = 0; a<fileList.length;a++){

var file = fileList;

if(file instanceof File && file.name.match(/\.(jpg|tif|gif|png)$/i)){

open(file);

if(documen...























Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 04, 2009 Feb 04, 2009
I guess I misunderstood the question...now I get it and the script works perfectly. I have been using Contact sheet II to do what I need but now I am experiencing some irratic behavior with it, It seems to not like my math?and even though I say make the image this size and don't leave any space between rows, it leaves 1 pixel....In any case I started using the amazing script that Paul wrote (Thank you!) and now have hit a bump with it, I need to limit the page size to very specific sizes (i.e 1024x4096 or some other sizes) Pauls script will make them left to right...but how do I tell it to stop and move down to another row? I need to control this per image strip...

Oh and one more thing...how do I flatten it between images I am now dealing with thousands and PS slows to a crawl

Thanks,

ChrisN
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 04, 2009 Feb 04, 2009
> Oh and one more thing...how do I flatten it between images

doc.flatten();

-X
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Feb 04, 2009 Feb 04, 2009
Christopher this may be of use?
http://www.ps-scripts.com/bb/viewtopic.php?t=1824
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Feb 04, 2009 Feb 04, 2009
Ben, I think I got it wrong, did you mean to create a strip bottom up?
If so this should do it.



selectedFolder = Folder.selectDialog( "Please select input folder");

var fileList = selectedFolder.getFiles();

var strtRulerUnits = app.preferences.rulerUnits;

var strtTypeUnits = app.preferences.typeUnits;

app.preferences.rulerUnits = Units.PIXELS;

app.preferences.typeUnits = TypeUnits.PIXELS;

for(var a = 0; a<fileList.length;a++){

var file = fileList;

if(file instanceof File && file.name.match(/\.(jpg|tif|gif|png)$/i)){

open(file);

var Width = ...



























































Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 04, 2009 Feb 04, 2009
Hi Paul. Great script! Can it be made to work with transparent PNGs?

I guess merge visible could take the place of flatten?

But how do you keep the relative position of a masked area through the copy/paste function? For example let's say you have 256px square documents. In these documents let's say you have a 64b864 pix square that is filled and is off-center somewhere in the 256*256px document. If you cut/paste, photoshop seems to re-center the image. How do you avoid this?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 04, 2009 Feb 04, 2009
...and how do we reverse the order and build the strip from top down?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 04, 2009 Feb 04, 2009
thanks that will work, I just have to make dummy images to fill the gaps. I would rather a script that said "What are the image dimensions?" "How many rows?" "how many columns?" and it would have to allow multiple pages....
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Feb 04, 2009 Feb 04, 2009
Hi Andrew, png would pose a problem but might work with..
http://www.ps-scripts.com/bb/viewtopic.php?t=1824
It was a while back that I wrote it for someone and could do with a makeover. What this does is paste the documents into a selected area.
As for the above script for top - down.....



selectedFolder = Folder.selectDialog( "Please select input folder");

var fileList = selectedFolder.getFiles();

var strtRulerUnits = app.preferences.rulerUnits;

var strtTypeUnits = app.preferences.typeUnits;

app.preferences.rulerUnits = Units.PIXELS;

app.preferences.typeUnits = TypeUnits.PIXELS;

for(var a = 0; a<fileList.length;a++){

var file = fileList;

if(file instanceof File && file.name.match(/\.(jpg|tif|gif|png)$/i)){

open(file);

var Width...























































Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 04, 2009 Feb 04, 2009
It's not PNG itself that is the problem, but rather the transparency right? The problem is basically that there are no pixels at the edges of the docs, so both cut and paste and align give problems... right?

I've been banging my head against the wall for a few days on this one....

though I have an idea to try that might work: use resize-Canvas to add one pixel strip on the left and right edges of the source images. Fill these strips with a non-transparent color. Combine, as done with your script. Crop off the edges in the resulting image strip. I think that should work.

I'm trying to do it myself now, though i am semi-new to javascripting cs4.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Feb 05, 2009 Feb 05, 2009
How about this Andrew, this is for png only. What it does is put a white pixel in each corner at .001 opacity so it doesn't show.



selectedFolder = Folder.selectDialog( "Please select input folder");

var fileList = selectedFolder.getFiles();

var strtRulerUnits = app.preferences.rulerUnits;

var strtTypeUnits = app.preferences.typeUnits;

app.preferences.rulerUnits = Units.PIXELS;

app.preferences.typeUnits = TypeUnits.PIXELS;

for(var a = 0; a<fileList.length;a++){

var file = fileList;

if(file instanceof File && file.name.match(/\.(png)$/i)){

open(file);

var Width = activeDoc...



































































































Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2009 Feb 05, 2009
That works, but I don't like the idea of changing the files in any way, even if the added pixels are "almost" transparent. ....So I came up with the following:<br /><br />_____________________________________________________________<br /><br />//////////////////////////////////////////////////////////////////////////////////////////////////<br />app.preferences.rulerUnits = Units.PIXELS; <br />app.preferences.typeUnits = TypeUnits.PIXELS; <br />//////////////////////////////////////////////////////////////////////////////////////////////////<br /><br />selectedFolder = Folder.selectDialog( "Please select input folder"); <br /><br />var fileList = selectedFolder.getFiles(); <br />for(var aFile = 0; aFile<fileList.length;aFile++){ <br /> var file = fileList[aFile]; <br /> if(file instanceof File && file.name.match(/\.(jpg|tif|gif|png)$/i)){ <br /><br /> open(file);<br /> <br /> ////////////////////////////////////////Add Extra Boarder Stripe to maintain relative positon<br /> var Width =activeDocument.width.value; <br /> var Height =activeDocument.height.value; <br /> activeDocument.resizeCanvas(Width+2, Height, AnchorPosition.MIDDLECENTER)<br /> var Width =activeDocument.width.value; <br /> var Height =activeDocument.height.value;<br /> var fillColor = new SolidColor; <br /> fillColor.rgb.hexValue = '000000'; <br /> activeDocument.selection.select([[0,0],[1,0],[1,Height],[0,Height]], SelectionType.REPLACE, 0, false); <br /> activeDocument.selection.fill(fillColor, ColorBlendMode.NORMAL, 100, false ); <br /> activeDocument.selection.deselect(); <br /> activeDocument.selection.select([[(Width-1),0],[Width,0],[Width,Height],[(Width-1),Height]], SelectionType.REPLACE, 0, false); <br /> activeDocument.selection.fill(fillColor, ColorBlendMode.NORMAL, 100, false ); <br /> activeDocument.selection.deselect();<br /> ////////////////////////////////////////<br /><br /> if(documents.length > 1){ <br /><br /> ////////////////////////////////////////Add to Frame Strip<br /> activeDocument.selection.selectAll(); <br /> activeDocument.selection.copy(); <br /> activeDocument.close(SaveOptions.DONOTSAVECHANGES); <br /> activeDocument = documents[0]; <br /> app.activeDocument.resizeCanvas(app.activeDocument.width,app.activeDocument.height+Height, AnchorPosition.TOPCENTER); <br /> activeDocument.paste(); <br /> activeDocument.selection.selectAll(); <br /> align('AdBt'); <br /> app.activeDocument.selection.deselect(); <br /> activeDocument.mergeVisibleLayers();<br /> ////////////////////////////////////////<br /> } <br /><br /> }else{ <br /> continue; <br /> } <br />} <br /><br />////////////////////////////////////////Remove Extra Boarder Stripe and Save<br />var Width =activeDocument.width.value; <br />var Height =activeDocument.height.value; <br />activeDocument.resizeCanvas(Width-2, Height, AnchorPosition.MIDDLECENTER)<br /><br /> <br /> <br /> <br /><br />//////////////////////////////////////////////////////////////////////////////////////////////////<br />//CUSTOM FUNCTIONS<br />//////////////////////////////////////////////////////////////////////////////////////////////////<br /><br />function align(method) { <br /> var desc = new ActionDescriptor(); <br /> var ref = new ActionReference(); <br /> ref.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) ); <br /> desc.putReference( charIDToTypeID( "null" ), ref ); <br /> desc.putEnumerated( charIDToTypeID( "Usng" ), charIDToTypeID( "ADSt" ), charIDToTypeID( method ) ); <br /> executeAction( charIDToTypeID( "Algn" ), desc, DialogModes.NO ); <br />};
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2009 Feb 05, 2009
now the next question I have is how to make this a batch process?

I want to chooose a parent DIR with a dialog. This DIR will contain subfolders. These subfolders will contain the PNGs to combine. I want the script to look at each folder, run the above script, save the resulting document as PNG (avoiding any/all dialogs) in the parent folder using autonaming that makes the file the same as the name as the subfolder +.png.

Any help? I am on OSX for this task BTW.

I tried another loop using .getFolders instead of .getFiles, but that does not seem to work...
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2009 Feb 05, 2009
Here is my attempt to batch process folders:<br /><br />_____________________________________________________________________________<br /><br />//////////////////////////////////////////////////////////////////////////////////////////////////<br />app.preferences.rulerUnits = Units.PIXELS; <br />app.preferences.typeUnits = TypeUnits.PIXELS; <br />//////////////////////////////////////////////////////////////////////////////////////////////////<br /><br />selectedFolder = Folder.selectDialog( "Please select input folder"); <br /><br />var folderList = selectedFolder.getFolders(); <br />for(var aFolder = 0; aFolder<folderList.length;aFolder++)<br /> {<br /> var theFolder = folderList[aFolder]; <br /><br /> var fileList = theFolder.getFiles(); <br /> for(var aFile = 0; aFile<fileList.length;aFile++)<br /> { <br /> var file = fileList[aFile]; <br /> <br /> if(file instanceof File && file.name.match(/\.(jpg|tif|gif|png)$/i))<br /> { <br /> open(file);<br /> <br /> ////////////////////////////////////////Add Extra Boarder Stripe to maintain relative positon<br /> var Width =activeDocument.width.value; <br /> var Height =activeDocument.height.value; <br /> activeDocument.resizeCanvas(Width+2, Height, AnchorPosition.MIDDLECENTER)<br /> var Width =activeDocument.width.value; <br /> var Height =activeDocument.height.value;<br /> var fillColor = new SolidColor; <br /> fillColor.rgb.hexValue = '000000'; <br /> activeDocument.selection.select([[0,0],[1,0],[1,Height],[0,Height]], SelectionType.REPLACE, 0, false); <br /> activeDocument.selection.fill(fillColor, ColorBlendMode.NORMAL, 100, false ); <br /> activeDocument.selection.deselect(); <br /> activeDocument.selection.select([[(Width-1),0],[Width,0],[Width,Height],[(Width-1),Height]], SelectionType.REPLACE, 0, false); <br /> activeDocument.selection.fill(fillColor, ColorBlendMode.NORMAL, 100, false ); <br /> activeDocument.selection.deselect();<br /> //////////////////////////////////////// <br /><br /> if(documents.length > 1)<br /> { <br /> ////////////////////////////////////////Add to Frame Strip<br /> activeDocument.selection.selectAll(); <br /> activeDocument.selection.copy(); <br /> activeDocument.close(SaveOptions.DONOTSAVECHANGES); <br /> activeDocument = documents[0]; <br /> app.activeDocument.resizeCanvas(app.activeDocument.width,app.activeDocument.height+Height, AnchorPosition.TOPCENTER); <br /> activeDocument.paste(); <br /> activeDocument.selection.selectAll(); <br /> align('AdBt'); <br /> app.activeDocument.selection.deselect(); <br /> activeDocument.mergeVisibleLayers();<br /> ////////////////////////////////////////<br /> } <br /><br /> }else<br /> { <br /> continue; <br /> } <br /> } <br /><br /> ////////////////////////////////////////Remove Extra Boarder Stripe and Save<br /> var Width =activeDocument.width.value; <br /> var Height =activeDocument.height.value; <br /> activeDocument.resizeCanvas(Width-2, Height, AnchorPosition.MIDDLECENTER)<br /> <br /> activeDocument.close(SaveOptions.DONOTSAVECHANGES); <br /> <br /> <br /> } <br /><br />//////////////////////////////////////////////////////////////////////////////////////////////////<br />//CUSTOM FUNCTIONS<br />//////////////////////////////////////////////////////////////////////////////////////////////////<br /><br />function align(method) { <br /> var desc = new ActionDescriptor(); <br /> var ref = new ActionReference(); <br /> ref.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) ); <br /> desc.putReference( charIDToTypeID( "null" ), ref ); <br /> desc.putEnumerated( charIDToTypeID( "Usng" ), charIDToTypeID( "ADSt" ), charIDToTypeID( method ) ); <br /> executeAction( charIDToTypeID( "Algn" ), desc, DialogModes.NO ); <br />}; <br /><br />_____________________________________________<br /><br />I get an error stating .getFolders is not a valid function.... Any idea how to get a list folders in a parent folder in Javscript and iternate through these? On OSX?<br /><br />I can do it with AppleScript, but I can't code the things needed above with appleScript...
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Feb 05, 2009 Feb 05, 2009
I will have to have a think about that one Andrew.

I have also created an all singing version that can create the strips in all four directions. JPG or PNG supported, also a range of the selected type can be processed.
You can download it here....
http://ps-scripts.com/bb/viewtopic.php?p=10695#10695
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2009 Feb 05, 2009
Is there a way to pass on the folder selection from AppleScript to JavaScript, so that instead of:

selectedFolder = Folder.selectDialog( "Please select input folder");

...the folder info is supplied by AppleScript?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Feb 05, 2009 Feb 05, 2009
Applescript is a total mystery to me as I only use JavaScript even on the couple of Macs that I have.

Just been playing, and this code should create a full list of PNG files from the selected folder plus sub folders...





var imageFolder = Folder.selectDialog("Select the folder to process");

pngList=[];

if (imageFolder != null) processFolder(imageFolder);

pngList = ReturnUniqueSortedList(pngList)

alert("Number of PNG files found = " + pngList.length);



function processFolder(folder) {

var fileList = folder.getFiles()

for (var i = 0; i < fileList.length; i++) {

var file = fileList;

if (file instanceof File && file.name.match(/\.png$/i)) {

pngList.push(file);

} else

if (file instanceof Folder) {

processFolder(file);

}

}

}

function ReturnUniqueSortedList(ArrayName){

var unduped = new Object;

for (var i = 0; i < ArrayName.length; i++) {

unduped[ArrayName] = ArrayName;

}

var uniques = new Array;for (var k in unduped) {

uniques.push(unduped);}

uniques.sort();

return uniques;

}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2009 Feb 05, 2009
I don't want to combine all subfolder content though. I want to process each subfolder separately. I simply want to apply the script to all subfolders in parent folder, one at time...

I think the above is a method to search through all nested subfolders and make one huge pict list, right?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines