Skip to content

Instantly share code, notes, and snippets.

View opdude's full-sized avatar

Daniel Hobley opdude

  • Unity Technologies
  • Copenhagen, Denmark
View GitHub Profile
@opdude
opdude / SplitSpriteSheet.jsx
Created October 3, 2012 10:45
Photoshop script that splits a image up into squares and save the output to files
function callAction(xMax, yMax, width, height, origDoc)
{
var count = 0;
for(var y = 0; y < yMax; y++)
{
for (var x=0; x <xMax; x++) {
SelectAndCopy(x * width, y * height, width, height);
PasteToNewDocument(width, height);
SaveImage(count, origDoc);
CloseDoc();