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 ?).
The modification is quite untested, I hope I have'nt broke something else... Don't hesitate to mail me !
| Attachment | Size |
|---|---|
| layers-slices.scm v0.1 | 5.89 KB |
| layers-slices.scm v0.2 | 6.01 KB |
| layers-slices.scm v0.3 | 6.7 KB |
Comments
v3
PNG transparency works as expected. And transparency on JPEGs turn black indeed.
Very nice job, thanks a lot!
This looks really nice
Slice plugin problem
Good plugin!
Compared to other plugins,
Compared to other plugins, this one does'nt require slices to be next to each other or to completely fill the image. They can even overlap each other...
In this context, you can't create an HTML table...
HTML file
Well no, a table might be impossible. But who still uses tables to make layouts nowadays? If you do, you seriously should consider going more professional. A table is for showing data, not for layouts. Use for instance DIV tags to build your layout with a CSS stylesheet. Much easier and more reliable.
Anyway, what I wanted to say is... an HTML and CSS file with the image on the right position using DIV tags and stylesheets IS possible. THAT would be awesome!! Since I now have to move them manually to the right places.
trouble with runnin plugin
I have the same problems,
Length of all layer's names
Finally corrected in v0.2...
Finally corrected in v0.2...
Please add example. Can you
Great plugin! After looking
That's true, it's the size
That's true, it's the size of the layer.
I choose that because it has to be square, the displayed limit are between pixels and it's easy to handle (via the layer crop tool)