Cutting image in parts
I have an image, i want to get 9 by 7 equal rectangles as layers, the size of the image is different.
this could be portrait as also landscape.
the 63 rectangles should be in 63 layers.
Thanks to the experts!!!
I have an image, i want to get 9 by 7 equal rectangles as layers, the size of the image is different.
this could be portrait as also landscape.
the 63 rectangles should be in 63 layers.
Thanks to the experts!!!
Nope, but you could run this script and it will create your layers...
#target photoshop
if(documents.length){
var startRulerUnits = preferences.rulerUnits;
preferences.rulerUnits = Units.PIXELS;
doc = app.activeDocument;
app.displayDialogs = DialogModes.NO;
doc.flatten();
var tilesAcross =9;
var tilesDown =7;
var tileWidth = parseInt(doc.width/tilesAcross);
var tileHeight = parseInt(doc.height/tilesDown);
ProcessFiles(tilesDown,tilesAcross,tileWidth,tileHeight);
app.preferences.rulerUnits = startRulerUnits;
}
function ProcessFiles(Down,Across,offsetX,offsetY){
try{
var newName = activeDocument.name.match(/(.*)\.[^\.]+$/)[1];
}catch(e){var newName="UntitledChop"}
TLX = 0; TLY = 0; TRX = offsetX; TRY = 0;
BRX = offsetX; BRY = offsetY; BLX = 0; BLY = offsetY;
for(var a = 0; a < Down; a++){
for(var i = 0;i <Across; i++){
var NewFileName = newName +"#"+a+"-"+i;
activeDocument.selection.select([[TLX,TLY],[TRX,TRY],[BRX,BRY],[BLX,BLY]], SelectionType.REPLACE, 0, false);
executeAction( charIDToTypeID( "CpTL" ), undefined, DialogModes.NO );
activeDocument.activeLayer.name = NewFileName;
app.activeDocument.selection.deselect();
activeDocument.activeLayer = activeDocument.artLayers.getByName("Background");
TLX = offsetX * (i+1) ; TRX = TLX + offsetX; BRX = TRX; BLX = TLX;
}
TLX = 0; TLY = offsetY * (a +1); TRX = offsetX; TRY = offsetY * (a +1);
BRX = offsetX; BRY = TRY + offsetY; BLX = 0; BLY = (offsetY * (a +1)+offsetY);
}
};
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.