10 Replies Latest reply: Apr 10, 2012 9:26 AM by JJMack RSS

    auto tile 100's of images?

    SeanJM123 Community Member

      Hey guys, i have used batch process to make a whole bunch of photos one size.  I need to create a single 'photo wall' jpg out of them in which they're all tiled, the long way of doing this is to obv open them all and copy, paste into the psd, then flatten, but thats really, really time consuming.  I was wondering if anyone knew if photoshop had any type of auto import & tile feature?  I may have to do this a 2nd time with 1000's of images so I'm really hoping there's a more time friendly method.. Thanks

        • 1. Re: auto tile 100's of images?
          JJMack CommunityMVP

          I wrote a script to tile image so they could be printed on roll paper.  This script would probally do what you want. If all tour images have the same orintation. For the script will rotate your images for best fit. For example if the tile size you set is a landscape tile landscape images will be sized for best fit and portrait images will be ratated and sized for best fit. If the tils size is a protrat size landscapes will be rotated first.  Images are not croped just masked so you can tweak the virtual crop using the move tool

          http://www.mouseprints.net/old/dpr/PasteImageRoll.html  http://www.mouseprints.net/old/dpr/PasteImageRoll.jsx



          • 2. Re: auto tile 100's of images?
            SeanJM123 Community Member

            thanks this looks good, a little confused as to how I'd get it to fit say 1200 high (so 6 rows) and as long as it takes

            • 3. Re: auto tile 100's of images?
              JJMack CommunityMVP

              Its simple math. to do 1200 images in 6 rows you would need very wide paper. What you most likely want is six columns and 200 rows. If you images are landscape you would make the tile a portrait aspect ratio so landscape images would be rotated to fit. Them when you printed the 200 row with 6 columns when you printed it you would rotate the paper and wind up with 6 rows with 200 columns, When you wrote 1200 high I think you ment pixels and if your talking landscape rotated into portrait tiles the 1200 would be width. like 4" at 300DPI so you would set the Script to use 300 DPI  if your camera is a 3:2 Aspect ratio Camera set the tile width to 4 and the height to 6 your images when you rotate the paper will be 1800x1200 pixels ie 6"x4" at 300DPI to get 6 columns the roll paper width would be 2' to get 200 rows the roll length would be 100'. After printintg you rotate the paper so it is 100' wide and 2' high. You need a long wall to hang it on.


              Your dealing with tiles rows and columns. Printers can only print so wide and paper come just so wide. 1200 image are a lot of images let say your dealing with people portraits they have a more square aspect ratio like 4x5.  You would still want them to be printed rotated and rotate the printed roll on your wall so you would set the tile size to be a landscape aspect ratio so portraits would be rotated. So tile size would be set 5"x4".  Next Printers and Roll Paper width. Epson make Large roll paper printers up to 64" wide.  5" Colums would limit you to max of  12 width would be 60" wide or 5' Epson sells 60" x 100' paper rolls. So your 1200 portraits would print 100 rows of 12 columns and use 33.3333' of the100' roll. If hung on an 8' high wall 6" down from the top.  The image would be two and a half foot off the floor and extend up to the seven and a half foot height and the wall still needs to be 33'3' long.  1200 images are a lot of images 12 rows a 100 portraits is a lot to take in.

              • 4. Re: auto tile 100's of images?
                c.pfaffenbichler Community Member

                open them all and copy, paste into the psd, then flatten, but thats really, really time consuming.

                File > Scripts > Load Files into Stack would make that part easier.

                • 5. Re: auto tile 100's of images?
                  Paul Riggott Community Member

                  Photoshop may not be the best application to do this, you might be bettor off using Picasa as this has this function built in.


                  • 6. Re: auto tile 100's of images?
                    JJMack CommunityMVP

                    My script will do the whole process of masking the images to the tile size and lay out the tiles 1200 images are a lot of images however Photoshop can handle up to 8000 layers. Still an image that large is going to take a lone time to create. If images are 4x5 portraits 300dpi would be 60" wide and 33.333 feet long 60x300=18,000 pixel wide 400x300 120,000 pixels high. That is 2,160,000,000 pixels over 2GP I do not know if it could be printed???  Script is not hard or the complicated.



                    /* ==========================================================

                    // 2012  John J. McAssey (JJMack)

                    // ======================================================= */



                    // This script is supplied as is. It is provided as freeware.

                    // The author accepts no liability for any problems arising from its use.



                    /* Help


                    <about>$$$/JavaScripts/PasteImageRoll/About=JJMack's PasteImageRoll^r^rCopyright 2012 Mouseprints.^r^rCreate a document for printing on roll paper^rcan also be used as a wall hanging when^rall selected images have the same orientation.^rImages will be rotated to match cell orientation</about>

                    <category>JJMack's Collage Script</category>





                    //Set Defaults here

                    var dfltRes = 300;          // default print DPI

                    var dfltCpys = 1;          // default image copies

                    var dfltPw  = 16;          // default roll paper width in inches

                    var dfltPl  = '';          // default roll paper length in feet. if set to null script will use 100 ft.

                    var dfltCw  = 4;          // default cell width in inches best if it divides paper with evenly.

                    var dfltCh  = 6;          // default cell height in inches

                    //End Defaults



                    var startRulerUnits = app.preferences.rulerUnits;

                    app.preferences.rulerUnits = Units.PIXELS; // tell ps to work with pixels



                    try {

                              // begin dialog layout

                              var RollPaperDialog = new Window('dialog');

                              RollPaperDialog.text = 'Paste Image Roll';

                              RollPaperDialog.frameLocation = [70, 70];

                              RollPaperDialog.alignChildren = 'center';



                              RollPaperDialog.PrintResPnl = RollPaperDialog.add('panel', [2, 2, 200, 56], 'Print Resolution');

                                        RollPaperDialog.PrintResPnl.add('statictext', [10, 16, 50, 48], 'DPI ');

                                        RollPaperDialog.PrintResPnl.docResEdt = RollPaperDialog.PrintResPnl.add('edittext', [50, 13, 90, 34], dfltRes, {name:'prtRes'});

                                        RollPaperDialog.PrintResPnl.docResEdt.helpTip = 'Image Resolution';

                                        RollPaperDialog.PrintResPnl.add('statictext', [96, 16, 140, 48], 'Copies ');

                                        RollPaperDialog.PrintResPnl.imgCpysEdt = RollPaperDialog.PrintResPnl.add('edittext', [140, 13, 175, 34], dfltCpys, {name:'imgCpys'});

                                        RollPaperDialog.PrintResPnl.imgCpysEdt.helpTip = 'Number of copies of selected Images';



                              RollPaperDialog.PaperSizePnl = RollPaperDialog.add('panel', [2, 2, 200, 56], 'Roll Paper Size');

                                        RollPaperDialog.PaperSizePnl.add('statictext', [10, 16, 50, 48], 'Width ');

                                        RollPaperDialog.PaperSizePnl.aspectWidthEdt = RollPaperDialog.PaperSizePnl.add('edittext', [50, 13, 90, 34], dfltPw, {name:'pprWth'});

                                        RollPaperDialog.PaperSizePnl.aspectWidthEdt.helpTip = 'Roll width in inches';

                                        RollPaperDialog.PaperSizePnl.add('statictext', [96, 16, 140, 48], 'Length ');

                                        RollPaperDialog.PaperSizePnl.aspectHeightEdt = RollPaperDialog.PaperSizePnl.add('edittext', [140, 13, 175, 34], dfltPl, {name:'pprLnth'});

                                        RollPaperDialog.PaperSizePnl.aspectHeightEdt.helpTip = 'Remaing roll length in feet';



                              RollPaperDialog.CellSizePnl = RollPaperDialog.add('panel', [2, 2, 200, 56], 'Tile Cell Size');

                                        RollPaperDialog.CellSizePnl.add('statictext', [10, 16, 50, 48], 'Width ');

                                        RollPaperDialog.CellSizePnl.aspectWidthEdt = RollPaperDialog.CellSizePnl.add('edittext', [50, 13, 90, 34], dfltCw, {name:'cllWth'});

                                        RollPaperDialog.CellSizePnl.aspectWidthEdt.helpTip = 'Width in inches';

                                        RollPaperDialog.CellSizePnl.add('statictext', [96, 16, 140, 48], 'Height ');

                                        RollPaperDialog.CellSizePnl.aspectHeightEdt = RollPaperDialog.CellSizePnl.add('edittext', [140, 13, 175, 34], dfltCh, {name:'cllHgt'});

                                        RollPaperDialog.CellSizePnl.aspectHeightEdt.helpTip = 'Height in inches';



                              var buttons = RollPaperDialog.add('group');

                              buttons.orientation = 'row';

                                                  var okBtn = buttons.add('button');

                                        okBtn.text = 'OK';

                                        okBtn.properties = {name: 'ok'};

                                                  var cancelBtn = buttons.add('button');

                                        cancelBtn.text = 'Cancel';

                                        cancelBtn.properties = {name: 'cancel'};



                              // display dialog and only continues on OK button press (OK = 1, Cancel = 2)

                              if (RollPaperDialog.show() == 1) {

                                        //variables passed from user interface

                                        var res                    = String(RollPaperDialog.PrintResPnl.prtRes.text);

                                        var copies          = String(RollPaperDialog.PrintResPnl.imgCpys.text);

                                        var pprwidth    = String(RollPaperDialog.PaperSizePnl.pprWth.text);

                                        var pprlength   = String(RollPaperDialog.PaperSizePnl.pprLnth.text); if (pprlength=='') { pprlength= 100; }

                                        var cellwidth   = String(RollPaperDialog.CellSizePnl.cllWth.text);

                                        var cellheight  = String(RollPaperDialog.CellSizePnl.cllHgt.text);



                                        var maxpaperwidth=pprwidth*res;                    // Printer Paper width in pixels inches*res 

                                        var maxpaperlnth=pprlength*12*res;          // Printer Paper Roll length in pixels

                                        var width=cellwidth*res;                    // Document Cell width in pixels inches*res

                                        var height=cellheight*res;                    // Document Cell height in pixels inches*res

                                        var cols=0;                                        // Document number of columns will be determined by script using paper width and cell width 

                                        var rows=0;                                        // Document rows will be determined by script using columns and # of images selected



                                        if (width>maxpaperwidth) { throw "error1"; }

                                        cols=Math.round((maxpaperwidth/width)-.499); //round down

                                        if (height>maxpaperlnth) { throw "error2"; }

                                        var file = new Array();

                                        file = app.openDialog();//opens dialog,choose images

                                        if (file.length<1) { throw "error3"; }

                                        rows=Math.round((file.length*copies/cols)+.499); //round up

                                        if (height*rows>maxpaperlnth) { throw "error4"; }

                                        var doc = app.documents.add(width*cols, height*rows, res);

                                        var currrow=0; var pasted=0;

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

                                                  app.load(file[i]); //load it into documents

                                                  var backFile= app.activeDocument; //prepare your image layer as active document

                                                  flatten(); //handle layered images

                                                  if (backFile.width.value<backFile.height.value&&width>height ) { backFile.rotateCanvas(-90.0);  } // Rotate portraits

                                                  if (backFile.height.value<backFile.width.value&&height>width ) { backFile.rotateCanvas(-90.0);  } // Rotate landscapes

                                                  if (backFile.width.value/backFile.height.value > width/height) { backFile.resizeImage(null, height, null, ResampleMethod.BICUBIC); } // wider

                                                  else {backFile.resizeImage(width, null, null, ResampleMethod.BICUBIC);} // same aspect ratio or taller


                                                  backFile.selection.copy(); //copy resized image into clipboard

                                                  backFile.close(SaveOptions.DONOTSAVECHANGES); //close image without saving changes


                                                  for (var n=0;n<copies;n++) {



                                                            var x =pasted*width;

                                                            var y =currrow*height;

                                                            var selectedRegion = Array(Array(x,y), Array(x+width,y), Array(x+width,y+height), Array(x,y+height));




                                                            doc.paste(true); //paste image into masked layer your document


                                                            align('AdCH'); align('AdCV');



                                                            if ( pasted==cols ) { pasted=0; currrow++; }




                              else {

                                        //alert('Operation Canceled.');


                              // Return the app preferences

                              app.preferences.rulerUnits = startRulerUnits;



                              // Return the app preferences

                              app.preferences.rulerUnits = startRulerUnits;

                              if (err=="error1") {alert("Paper width exceeded reduce the cell width");}

                              else if (err=="error2") {alert("Paper roll length exceeded reduce cell height");}

                              else if (err=="error3") {alert("No Images Selected");}

                              else if (err=="error4") {alert("Paper roll length exceeded try selecting fewer images or reducing cell height");}

                              // Lot's of things can go wrong, Give a generic alert and see if they want the details

                              else if ( confirm("Sorry, something major happened and I can't continue! Would you like to see more info?" ) ) { alert(err + ': on line ' + err.line ); }




                    // -----------------------------------------

                    // flatten Image

                    // -----------------------------------------

                    function flatten() {


                                        executeAction( charIDToTypeID( "FltI" ), undefined, DialogModes.NO );





                    // -----------------------------------------

                    // Align Layers to selection

                    // -----------------------------------------

                    function align(method) {

                              var desc = new ActionDescriptor();

                              var ref = new ActionReference();

                              ref.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );

                              desc.putReference( charIDToTypeID( "null" ), ref );

                              desc.putEnumerated( charIDToTypeID( "Usng" ), charIDToTypeID( "ADSt" ), charIDToTypeID( method ) );


                                        executeAction( charIDToTypeID( "Algn" ), desc, DialogModes.NO );




                    • 7. Re: auto tile 100's of images?
                      JJMack CommunityMVP

                      Paul I trust your knowledge can Picasa create and print an image that is over 2GP???


                      I tried CS5 to create a new document 60" wide by 400" high ate 300 DPI it can do it but gives you a warning meaasge about older programs are not able to handle images larger then 30,000x30,000

                      • 8. Re: auto tile 100's of images?
                        SeanJM123 Community Member

                        This is not for print, its for a video ( i need the images scrolling from left to right).  Will try both methods, thanks

                        • 9. Re: auto tile 100's of images?
                          Paul Riggott Community Member

                          If you want to make a video, you could use File - Scripts - "Load Files into Stack" and produce an avi.

                          • 10. Re: auto tile 100's of images?
                            JJMack CommunityMVP

                            He wants images tiled in rows and columns I think "Load Files into Stack"  then creating a AVI would be better suited for a time laps animation then laying out layers out as tiles then scrolling across the tiled layout. I beleive the script will do exactly what he wants. I just have no idea of how long it will take to layout 1200 tile layers or if his PC has the resources Photoshop would need to eat the process.


                            He now states its not for print so the 1200 pixel hight may be the total width of the vertical scroll. Then an image height would only be 200 pixels when the scroll is rotated 90 to produce 6. rows with 200 columns. If 200 is a landscape height and 300 the landscape with the tile setup would be 2" x 3" at 100DPI and the roll paper width woud be 12" so there would be 6 colums of portrait images that 1200 Landscape images would be rotated to fit into 200 rows 3" high paper length 3"*200=600" or 50' at 100DPI 60,000 pixels. Total image size when the roll is rotated 90 is 60,000 px wide 1200 px high and he will have his 6 rows that will have  200 colums of 3"x2" landscape images. 60,000*1,200=72,000,000 only 72MP after he flattens the created document. He would need to save this a TIFF file Photoshop can not save a jpeg image that is 60,000 px wide.  I think that this could be created still I have no idea how long it will take to Open 1200 image files rotate, size and mask them to produce the final image. I'm sure there are video programs that can import a still image and scroll across it. I do not know if they can import a Tiff image that is 60,000 px wide by 1200 px high..... 50:1 is a supper wide aspect ratio.