Skip to main content
piro12345
Participating Frequently
September 11, 2017
Answered

Dividing big document to smaller ones

  • September 11, 2017
  • 3 replies
  • 3786 views

Hello,

I've got a problem because currently I'am working on a 1x20m banner, but my computer cant handle such big document and everything is starting to get laggy as i work on it. Can i divide my 1x20 m  document into  four 1x5 but with all layers and effects, without merging all layers??

    This topic has been closed for replies.
    Correct answer c.pfaffenbichler

    This Script should split a file into segments, but I am not sure this will be necessary.

    // split image into x times y segments and save them as psds;

    // 2017, use it at your own risk;

    #target photoshop

    if (app.documents.length > 0) {

    var originalUnits = app.preferences.rulerUnits;

    app.preferences.rulerUnits = Units.PIXELS;

    // document;

    var myDocument = app.activeDocument;

    var theName= myDocument.name.match(/(.*)\.[^\.]+$/)[1];

    var thePath = myDocument.path;

    var theCopy = myDocument.duplicate("copy", false);

    // the numbers;

    var theX = 2;

    var theY = 2;

    var xFrac = myDocument.width/theX;

    var yFrac = myDocument.height/theY;

    // psd options;

    psdOpts = new PhotoshopSaveOptions();

    psdOpts.embedColorProfile = true;

    psdOpts.alphaChannels = true;

    psdOpts.layers = true;

    psdOpts.spotColors = true;

    // create folder;

    var folderName = thePath+"/"+theName+"_"+theX+"x"+theY;

    if (Folder(folderName).exists == false) {Folder(folderName).create()};

    //save jpgs;

    for (var n = 1; n <= theY; n++) {

    for (var m = 1; m <= theX; m++) {

    cropTo((m-1)*xFrac, (n-1)*yFrac, m*xFrac, n*yFrac);

    var theNewName = theName+"_"+bufferNumberWithZeros(m, 3)+"_"+bufferNumberWithZeros(n, 3);

    theCopy.saveAs((new File(folderName+"/"+"_"+theNewName+".psd")),psdOpts,true);

    theCopy.activeHistoryState = theCopy.historyStates[0];

    }

    };

    theCopy.close(SaveOptions.DONOTSAVECHANGES);

    // reset;

    app.preferences.rulerUnits = originalUnits;

    };

    ////// buffer number with zeros //////

    function bufferNumberWithZeros (number, places) {

    var theNumberString = String(number);

    for (var o = 0; o < (places - String(number).length); o++) {

    theNumberString = String("0" + theNumberString)

    };

    return theNumberString

    };

    ////// crop //////

    function cropTo (x1, y1, x2, y2) {

    // =======================================================

        var desc7 = new ActionDescriptor();

            var desc8 = new ActionDescriptor();

            var idPxl = charIDToTypeID( "#Pxl" );

            desc8.putUnitDouble( charIDToTypeID( "Top " ), idPxl, y1 );

            desc8.putUnitDouble( charIDToTypeID( "Left" ), idPxl, x1);

            desc8.putUnitDouble( charIDToTypeID( "Btom" ), idPxl, y2 );

            desc8.putUnitDouble( charIDToTypeID( "Rght" ), idPxl, x2 );

        var idRctn = charIDToTypeID( "Rctn" );

        desc7.putObject( charIDToTypeID( "T   " ), idRctn, desc8 );

        desc7.putUnitDouble( charIDToTypeID( "Angl" ), charIDToTypeID( "#Ang" ), 0.000000 );

        desc7.putBoolean( charIDToTypeID( "Dlt " ), false );

        desc7.putEnumerated( stringIDToTypeID( "cropAspectRatioModeKey" ), stringIDToTypeID( "cropAspectRatioModeClass" ), stringIDToTypeID( "pureAspectRatio" ) );

        desc7.putBoolean( charIDToTypeID( "CnsP" ), false );

    executeAction( charIDToTypeID( "Crop" ), desc7, DialogModes.NO );

    };

    3 replies

    D Fosse
    Community Expert
    Community Expert
    September 11, 2017

    25 - 30 ppi should normally be enough for this.

    People always overestimate the ppi requirements for large scale printing. Worst case, they've been told "300ppi" as if that was some universal law of nature.

    Generally, anything above 15000 pixels long side is probably more than you need.

    piro12345
    piro12345Author
    Participating Frequently
    September 11, 2017

    Thanks guys, I will remember that in the future, but whats wrong in adding a bit more DPI? Are there any downsides?

    D Fosse
    Community Expert
    Community Expert
    September 11, 2017

    Nothing wrong as such, as long as your system can handle it. But it may be completely wasted.

    Seen from a couple of meters away, there's no way the eye can resolve, say, 72 individual pixels to an inch. You don't have to step back much before an inch gets really small.

    This really boils down to degrees of arc in your total field of vision.

    c.pfaffenbichler
    Community Expert
    c.pfaffenbichlerCommunity ExpertCorrect answer
    Community Expert
    September 11, 2017

    This Script should split a file into segments, but I am not sure this will be necessary.

    // split image into x times y segments and save them as psds;

    // 2017, use it at your own risk;

    #target photoshop

    if (app.documents.length > 0) {

    var originalUnits = app.preferences.rulerUnits;

    app.preferences.rulerUnits = Units.PIXELS;

    // document;

    var myDocument = app.activeDocument;

    var theName= myDocument.name.match(/(.*)\.[^\.]+$/)[1];

    var thePath = myDocument.path;

    var theCopy = myDocument.duplicate("copy", false);

    // the numbers;

    var theX = 2;

    var theY = 2;

    var xFrac = myDocument.width/theX;

    var yFrac = myDocument.height/theY;

    // psd options;

    psdOpts = new PhotoshopSaveOptions();

    psdOpts.embedColorProfile = true;

    psdOpts.alphaChannels = true;

    psdOpts.layers = true;

    psdOpts.spotColors = true;

    // create folder;

    var folderName = thePath+"/"+theName+"_"+theX+"x"+theY;

    if (Folder(folderName).exists == false) {Folder(folderName).create()};

    //save jpgs;

    for (var n = 1; n <= theY; n++) {

    for (var m = 1; m <= theX; m++) {

    cropTo((m-1)*xFrac, (n-1)*yFrac, m*xFrac, n*yFrac);

    var theNewName = theName+"_"+bufferNumberWithZeros(m, 3)+"_"+bufferNumberWithZeros(n, 3);

    theCopy.saveAs((new File(folderName+"/"+"_"+theNewName+".psd")),psdOpts,true);

    theCopy.activeHistoryState = theCopy.historyStates[0];

    }

    };

    theCopy.close(SaveOptions.DONOTSAVECHANGES);

    // reset;

    app.preferences.rulerUnits = originalUnits;

    };

    ////// buffer number with zeros //////

    function bufferNumberWithZeros (number, places) {

    var theNumberString = String(number);

    for (var o = 0; o < (places - String(number).length); o++) {

    theNumberString = String("0" + theNumberString)

    };

    return theNumberString

    };

    ////// crop //////

    function cropTo (x1, y1, x2, y2) {

    // =======================================================

        var desc7 = new ActionDescriptor();

            var desc8 = new ActionDescriptor();

            var idPxl = charIDToTypeID( "#Pxl" );

            desc8.putUnitDouble( charIDToTypeID( "Top " ), idPxl, y1 );

            desc8.putUnitDouble( charIDToTypeID( "Left" ), idPxl, x1);

            desc8.putUnitDouble( charIDToTypeID( "Btom" ), idPxl, y2 );

            desc8.putUnitDouble( charIDToTypeID( "Rght" ), idPxl, x2 );

        var idRctn = charIDToTypeID( "Rctn" );

        desc7.putObject( charIDToTypeID( "T   " ), idRctn, desc8 );

        desc7.putUnitDouble( charIDToTypeID( "Angl" ), charIDToTypeID( "#Ang" ), 0.000000 );

        desc7.putBoolean( charIDToTypeID( "Dlt " ), false );

        desc7.putEnumerated( stringIDToTypeID( "cropAspectRatioModeKey" ), stringIDToTypeID( "cropAspectRatioModeClass" ), stringIDToTypeID( "pureAspectRatio" ) );

        desc7.putBoolean( charIDToTypeID( "CnsP" ), false );

    executeAction( charIDToTypeID( "Crop" ), desc7, DialogModes.NO );

    };

    c.pfaffenbichler
    Community Expert
    Community Expert
    September 11, 2017

    I'am working on a 1x20m banner

    What are the resolution and bit depth?

    piro12345
    piro12345Author
    Participating Frequently
    September 11, 2017

    72 dpi
    8 bit per channel
    56693 x 3543

    c.pfaffenbichler
    Community Expert
    Community Expert
    September 11, 2017

    You might get away with an even lower resolution.

    What print resolution works for what viewing distance?