If you should need to actually split the image into »brick«-Layers one could use a Script to create a Path and use the individual subPathItems to copy content to a new Layer.
Edit: Instead of creating a Path one could naturally just create Selections straight away and use those for »Layer Via Copy«.
// create rectangular subPathItems in a brick-like pattern;
// 2025, use it at your own risk;
if (app.documents.length > 0) {
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var myDocument = activeDocument;
// the values;
var lines = 10;
var rows = 5;
var seam = 10;
// the dimensions;
var seam = seam * (72/myDocument.resolution);
var width1 = (myDocument.width * (72/myDocument.resolution) - seam * (rows - 1)) / rows;
var height1 = (myDocument.height * (72/myDocument.resolution) - seam * (lines - 1)) / lines;
// create path;
var anArray = [];
for (var x = 0; x < lines; x++) {
var theX = 0;
var theY = height1 * x + seam * x;
var bricksPerLine = rows;
if (String(x/2).indexOf(".") != -1) {
var theX = (-0.5) * (width1 + seam);
var bricksPerLine = rows+1;
};
for (var y = 0; y < bricksPerLine; y++) {
thisArray = new Array;
thisArray.push([[theX, theY], [theX, theY], [theX, theY], false]);
thisArray.push([[theX+width1, theY], [theX+width1, theY], [theX+width1, theY], false]);
thisArray.push([[theX+width1, theY+height1], [theX+width1, theY+height1], [theX+width1, theY+height1], false]);
thisArray.push([[theX, theY+height1], [theX, theY+height1], [theX, theY+height1], false]);
thisArray.push(true);
thisArray.push(1737);
anArray.push(thisArray)
var theX = theX + width1 + seam;
}
};
// create path;
createPath2022(anArray, Math.random());
// reset;
app.preferences.rulerUnits = originalRulerUnits;
};
////////////////////////////////////
////// create a path from collectPathInfoFromDesc2012-array //////
function createPath2022(theArray, thePathsName) {
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
// thanks to xbytor;
cTID = function(s) { return app.charIDToTypeID(s); };
sTID = function(s) { return app.stringIDToTypeID(s); };
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putProperty(cTID('Path'), cTID('WrPt'));
desc1.putReference(sTID('null'), ref1);
var list1 = new ActionList();
for (var m = 0; m < theArray.length; m++) {
var thisSubPath = theArray[m];
var desc2 = new ActionDescriptor();
desc2.putEnumerated(sTID('shapeOperation'), sTID('shapeOperation'), thisSubPath[thisSubPath.length - 1]);
var list2 = new ActionList();
var desc3 = new ActionDescriptor();
desc3.putBoolean(cTID('Clsp'), thisSubPath[thisSubPath.length - 2]);
var list3 = new ActionList();
for (var n = 0; n < thisSubPath.length - 2; n++) {
var thisPoint = thisSubPath[n];
var desc4 = new ActionDescriptor();
var desc5 = new ActionDescriptor();
desc5.putUnitDouble(cTID('Hrzn'), cTID('#Rlt'), thisPoint[0][0]);
desc5.putUnitDouble(cTID('Vrtc'), cTID('#Rlt'), thisPoint[0][1]);
desc4.putObject(cTID('Anch'), cTID('Pnt '), desc5);
var desc6 = new ActionDescriptor();
desc6.putUnitDouble(cTID('Hrzn'), cTID('#Rlt'), thisPoint[1][0]);
desc6.putUnitDouble(cTID('Vrtc'), cTID('#Rlt'), thisPoint[1][1]);
desc4.putObject(cTID('Fwd '), cTID('Pnt '), desc6);
var desc7 = new ActionDescriptor();
desc7.putUnitDouble(cTID('Hrzn'), cTID('#Rlt'), thisPoint[2][0]);
desc7.putUnitDouble(cTID('Vrtc'), cTID('#Rlt'), thisPoint[2][1]);
desc4.putObject(cTID('Bwd '), cTID('Pnt '), desc7);
desc4.putBoolean(cTID('Smoo'), thisPoint[3]);
list3.putObject(cTID('Pthp'), desc4);
};
desc3.putList(cTID('Pts '), list3);
list2.putObject(cTID('Sbpl'), desc3);
desc2.putList(cTID('SbpL'), list2);
list1.putObject(cTID('PaCm'), desc2);
};
desc1.putList(cTID('T '), list1);
executeAction(cTID('setd'), desc1, DialogModes.NO);
// name work path;
var desc30 = new ActionDescriptor();
var ref6 = new ActionReference();
var idPath = charIDToTypeID( "Path" );
ref6.putClass( idPath );
desc30.putReference( charIDToTypeID( "null" ), ref6 );
var ref7 = new ActionReference();
ref7.putProperty( idPath, charIDToTypeID( "WrPt" ) );
desc30.putReference( charIDToTypeID( "From" ), ref7 );
desc30.putString( charIDToTypeID( "Nm " ), thePathsName );
executeAction( charIDToTypeID( "Mk " ), desc30, DialogModes.NO );
/// get index;
var ref = new ActionReference();
ref.putProperty(stringIDToTypeID("property"), stringIDToTypeID("itemIndex"));
ref.putEnumerated( charIDToTypeID("Path"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var pathDesc = executeActionGet(ref);
app.preferences.rulerUnits = originalRulerUnits;
return pathDesc.getInteger(stringIDToTypeID("itemIndex"))
};
edited 2025-03-09
... View more