Photoshop Script: Layers to Sprite Sheet


Even though us engineers are crappy artists, we make up for it by coming up with clever ways to not do extra work. So in that spirit I made this simple Photoshop script that arranges your Photoshop Layers into a Sprite Sheet. You can get it from here.

The column and row numbers for the sprite sheet is calculated automatically from the number of layers. It will try to make the column and row count as close as possible, and will never make a sheet with empty cells. So if, for example, you have a prime number of layers, it will display them all in a single row instead of doing rows with some sprite-less cells. If you want the script to use a fixed column number, edit the file and change the value from “var cols = -1″ set it to the amount of columns you want.

Canvas Before ScriptCanvas After Script

Canvas before and after running the script

The script modifies the size of the canvas, but leaves the layers intact. The order for the sprites in the sheet is taken from the order of the layers (from bottom to top).

Layers Before ScriptLayers After Script

Layers before and after running the Script

Download Script

Comments

Leave a Reply