This script is meant to cut an image is smaller pieces and save these images automatically based on the size and names of specific layers, images to be used in web layouts.
Other options I found are based on guidelines. This approach has 2 drawbacks for me :
If I'm wrong with this analysis, tell me... this script is perhaps a bad duplicate of some existing plugin I don't know about...
The idea here is to create a layer for each slice you need. This layer has 2 important characteristics :
For each of these "SLICE-*" layer, the image will be flatten (without the "SLICE-*" layers themselves), cropped to the layer's size and saved in the directory specified in the requested parameters. For .jpg images, the compression quality is requested in the parameters.
This script is my first scheme script, and has to be considered beta quality at most...
Version 0.2 :
Corrected the bug when one layer name was < 6 characters
Version 0.3 :
Now keep the transparency when saving to .png. Be carefull, if you have transparent parts in a .jpg slice, as this format does'nt support alpha channel, it will be replaced b something else (black ?).
Version 0.4 :
Should work now with the layer groups.
The modification is quite untested, I hope I have'nt broke something else... Don't hesitate to mail me !