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 |
layers-slices.scm v0.4 | 7.76 KB |
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 !
Comments
Thanks and improvment
Thanks a lot it is a very usefull script.
I have also made a little improvment as i wished that layer or group could be hidden and not used.
If you wish to add this functionnality to your plugin please ask me i'll send you my code.
I did'nt want to create a new plugin as the base code is yours. It could be a 0.4 version supporting group (for gimp 2.7 at least)
Sorry, I don't receive
Sorry, I don't receive notifications when a message is posted... I can't find the option...
Of course, you can send me your patch at robert@percu.be.
Thanks !
Great script
I found this script very useful , and I wonder how is it that gimp doesn't implement this function yet ; the author is encouraged to continue improving this work.
Thank you .
v3
PNG transparency works as expected. And transparency on JPEGs turn black indeed.
Very nice job, thanks a lot!
Slice plugin problem