You are here

Layers cloning in GIMP

In search of a script that would duplicate, triplicate, etc. all or just specified layers of an image. Some of my images contain 50-60 layers, and I need each cloned layer placed above the original one.

Forums: 

Try my interleave-layers script and interleave the image with itself.

See http://gimp-tools.sourceforge.net/

In fact, I've been using half of your scripts available for download on SF and find them very useful! Mirror-layers and auto-crop-layers are among those I use extensively. Thank you for your contribution to the GIMP versatility!

Ok, back to the topic. What I really need is a combination of two of your scripts, interleave-layers and mirror-layers.

Interleave-layers script does exactly what I need - duplicates all layers in desired order (more often than not I need copies of some layers but I can deal with that), keeps layer masks and alpha, but since it creates new image all my selections and paths are gone (sometimes I have up to 30 small region selections on an image, sometimes - up to 4-5 paths, sometimes - all of the above). I know I can copy and paste paths to newly created image and do the same with selection through "selection to path". But given my workflow it is as tedious as duplicating each layer by good ol' "layer duplicate" way.
Mirror-layers works within the same image, after using it I have all my masks, paths and selections where I had left them, and it is great!!! But it does exactly what it supposed to do - mirrors layers.
If I were a smarter person I would have probably figured out a way to combine these two scripts. The problem is - I'm not. I will give it a try, though, and let you know what I got.

Thank you for your reply, Ofnuts.
Sincerely

interleave-layers is meant for animation, so the two stacks of layers are put together very late in the process, more or less just before export. A new image is created, so that the the two stacks are kept separate in case they have to be reworked (especially since mixing them again becomes trivial)(this also allows keeping these work layers that aren't part of the final image).

Thank you, saulgoode! I will definitely give it a try and let you know

Hmmm. Come to think of it... once you have all the new layers in the new image... just save it as XCF, an "File/Open as layers" in the old one, so you have the new layers with your selections and paths.

I've tried that too and it makes even a bigger mess. Instead of a "layer cake" of layers it makes a "layer cake" of sequences of layers. Besides, if say, I have 60-layer image and need duplicates of just 25 of them I'm getting 35 extra layers that I don't need. Well, I can get rid of them with Fx-Foundry Multi-Layer Tools in no time, but then again, I have to rearrange the good ones.
I've been thinking of writing a script on my own. It would duplicate layers and have 3 sliders
1. From frame (layer) - n
2. To frame (layer) - n
3. N times - n
and an option of adding to current image or creating a new one (flatten yes/no)
Since seemingly no one except me needs such a script, I'll probably try to incorporate it in Fx-F MLT or mig-gimp-layer-groups.scm just for personal use, rather than coming up with a separate script. Unlike Python, Script-Fu is Terra Incognita for me, but it's no problem.
Again, thanks for your help, Ofnuts

Subscribe to Comments for "Layers cloning in GIMP "