What I want to do is to take an image and to cut it up into small squares that are each in a different layer (not export them as individual images). For instance if I had an image that is 100px by 100px and wanted to take that one layer and create 100 layers each 10px by 10px squares. The image would look the same, but instead of being one layer it would be a grid of separate layers that seamlessly fit together like a puzzle. If I turned off the visibility of one of the layers it would look as if one square "piece" of the puzzle was missing.
I know that I can slice up an image in a grid, export the images and then open them as layers using Bridge. The problem with this approach is that I would end up with a 10px by 10px file with 100 layers stacked on top of each other instead of a 100px by 100px file with all of the layers arranged properly.
Thanks.
Best Answer
You can do this all using Javascript. Here's a quick little script I've written, it will copy your image into 100 layers, each 10px by 10px:
To use it, save that file and load it up with Photoshop by going to
Make sure the filetype is set to *.JS
If you want to change the size of your squares just open the JavaSCript file in Notepad, change the value for
squareSize
and save and run it.* EDIT *
If you want to do more advanced things with this script, you can download a Photoshop Scripting reference guide which lists all the classes, functions and variables you can work with. (For example how to rotate a layer).
The above script uses JavaScript syntax, however you can also use AppleScript, and VBScript to work with Photoshop.