ofn3-interleave-layers

Purpose

This script creates a new image by interleaving layers between layers of the current image. It covers two different modes of operations:

The top layer of each pair can be merged to the underlying layer with a given transparency and layer mode. The first set of layers comes from the calling image (the one through which the script is called).

In multiple-layer mode, the inserted layers come from another image already loaded in Gimp.

In single layer mode, the inserted layer can come from any loaded image (including the one used as a source for the base layers)

The script uses the selected layers in the calling image, and will not be enabled in the menus if there is only one selected layer. For multiple-layer mode both layer sets should hold the same number of layers.

The script only works on full-RGB or grayscale images.

Usage

The script is started by the Image > Interleave layers menus. This menu is disabled if: * The image is color indexed (GIF, and sometimes PNG). You need to convert the image to full-RGB or grayscale mode first. * There are no selected layers or only one selected layer in the image (this script expects multiple layers as input)

Parameters

Usage hints

Input image

If you deal with animations (in particular, GIFs) make sure that the images are not optimized (layers marked with (combine)). If so, de-optimize the image with Filters > Animation > Unoptimize. You can re-optimize them later.

If the image is color-indexed you have to convert it to full-RGB or grayscale before using the script.

Use of groups

Groups are supported in both the calling and the source image. They are copied verbatim, and flattened if you use the merge option.

Warning: selecting a layer group is not the same as selecting a layer group and its child layers. In the first case you have one frame to copy, in the second you have three.

Output image

The output image is created with the same dimensions, type, and precision/encoding as the calling image. So the difference between interleaving layers from A above layers in B, and interleaving layers from B under layers in A is that in the first case the output image inherits its characteristics from B and in the second case it inherits them from A.

Positioning the merged layers in the result

The layers are copied to the output image with the size and offsets from their origin image.

Here is how you can easily achieve two frequent use cases:

Combining two animations

Positioning an animation over a background