Tile images faster Photoshop script

posted in: Blog | 0
Tile images faster Photoshop script

I love creating seamless textures in Photoshop, so to increase speed when working in Photoshop I have created two script. First one is for automatic offsetting layers for 50% and the second one is intended for checking how the tiling looks inside of Photoshop.

Just select the layer and run the script.

Here is the first script for automatic tiling.

Download script Tile images faster

After you download change the file extension from .txt to .jsx just by renaming in order for it to work.


or
copy and paste this code

/*
LayerTilingChecker
version 1.0 
author  : Bojan Djulbic
website : http://www.bojandjulbic.com
tiles your image by doubling it.  
*/
#target photoshop
var activeDoc = app.activeDocument;
var myLayer =  activeDoc.activeLayer;
var docWidth = activeDoc.width/2;
var docHeight = activeDoc.height/2;
var duplicatedLayer = myLayer.duplicate();
duplicatedLayer.resize(50,50, AnchorPosition.MIDDLECENTER);
function MoveLayerTo(fLayer,fX,fY) {
var Position = fLayer.bounds;
Position[0] = fX - Position[0];
Position[1] = fY - Position[1];
fLayer.translate(-Position[0],-Position[1]);
}
MoveLayerTo(duplicatedLayer, docWidth, docHeight );
var moveDuplicatedLayer = duplicatedLayer.duplicate(); 
moveDuplicatedLayer.translate (docWidth ,docHeight);  
var moveDuplicatedLayer = duplicatedLayer.duplicate();
moveDuplicatedLayer.translate (docWidth ,0);  
var moveDuplicatedLayer = duplicatedLayer.duplicate();
moveDuplicatedLayer.translate (0,docHeight );  
var doc = app.activeDocument;
var doc = app.activeDocument;
var currentLayer = doc.activeLayer;
for(i=0; i < doc.layers.length; )
{         
if(doc.layers[i]==currentLayer)
{
a=i;
i = doc.layers.length;
}
else{ i++; }
}
try
{
var nextLayer = doc.layers[a-4];
var check = nextLayer.visible;
}
catch(e)
{
var nextLayer = doc.layers[0];
var check = nextLayer.visible;
}  
doc.activeLayer = nextLayer;
if (check == false)
doc.activeLayer.visible = false;
activeDoc.activeLayer.merge();
activeDoc.activeLayer.merge();
activeDoc.activeLayer.merge();
A quick reminder how to install scripts in Photoshop

Put the file offset50percent.jsx into this folder (check your version of the Photoshop)
01 – C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Presets\Scripts.
02 – Reset Photoshop and now under File>Browse script, you will see offset50percent.jsx in a drop down menu

 

Share with friends
  •  
  •  
  •  
  •  
  •  
  •  

Leave a Reply