Gino D's GIMP Scripts: https://sites.google.com/site/ginodonig/gimp-scripts
Overview
This script is a powerful tool designed to duplicate layers and channels in advanced mode.
It basically generates multiple copies of the active drawable into the current image, giving the possibility of spacing them along the horizontal and vertical directions. Furthermore, if the original drawable is a layer, the copies can be consecutively scaled and rotated, as well as conveniently combined inside the image, by putting them in a new layer group or merging them together. When enabling all of the transformations provided by the script, they will be applied to each duplicate in the following order: autocropping, displacement, scaling, rotation. Lastly, when this script is called from within another script, it outputs a vector whose elements are the identifiers of the generated duplicates.
Activating the script
Once installed, you can launch this script from the image menubar through
"Edit -> Multi-Replicate...".
It is also possible to access the script through the Layer local pop-menu or the Channel context menu, by right-clicking on the thumbnail of the specified layer or channel inside the relevant dialog.
Options
- Number of copies
-
Defines the number of duplicates to generate from the original drawable.
Values can range from 1 to 512.
- Autocrop layer copies
-
Checking this box will cause the layer copies to be automatically resized before any transformation, by removing the borders that are fully transparent.
- Displacement in X direction, Displacement in Y direction
-
Set the amounts by which each duplicate will be horizontally and vertically displaced with respect to the previous one before any scaling and rotation. These options also affect the first duplicate, that will be shifted by the same amounts relative to the original drawable.
Values can range from -4096 to 4096.
- Unit of measure for displacements
-
Here you can choose how to express the displacements in X and Y directions.
- % of duplicate extents:
as a percentage, respectively, of the width and the height of the current duplicate, by referring to its autocropped version if the “Autocrop layer copies” checkbox is enabled.
- % of scaled duplicate extents:
as a percentage, respectively, of the width and the height that the current (and possibly autocropped) duplicate will take after being scaled and before being rotated.
- % of image extents:
as a percentage, respectively, of the width and the height of the current image.
- Pixel:
in pixels.
The following illustration refers to the duplication of a layer depicting an ice lolly, whose copies are scaled and vertically displaced relative to one another. It shows the difference, in terms of results, between the first and the second option of the drop-down list in question.
- Final scale factor in X direction, Final scale factor in Y direction
-
Determine the scale factors by which to enlarge or reduce (before any rotation) the last duplicate relative to the original layer in horizontal and vertical direction respectively. When the number of copies is greater than two, the width and the height of each duplicate will be increased or decreased, relative to the respective ones of the preceding layer, by constant length increments, until reaching the maximum or minimum dimensions at the last layer copy.
Values vary within a range of 0 to 4.
- Starting angle of rotation (in degrees)
-
Specifies the angle through which the first duplicate will be rotated relative to the original layer.
Values can range from -180 to 180, where positive values correspond to clockwise rotations and negative values correspond to counterclockwise rotations.
- Incremental angle of rotation (in degrees)
-
Specifies the fixed angular increment through which each layer copy following the first one will be rotated relative to the previous duplicate.
Values can range from -180 to 180, where positive values correspond to clockwise rotations and negative values correspond to counterclockwise rotations.
- X coordinate of rotation center, Y coordinate of rotation center
-
Set the horizontal and vertical coordinates of the center around which the layer copies will rotate, namely the horizontal and vertical distances from the origin selected in the “Origin of coordinates” option.
Values vary within a range of -262144 to 262144.
- Unit of measure for coordinates
-
Here you can choose how to express the X and Y coordinates of the rotation center.
- % of duplicate extents:
as a percentage, respectively, of the width and the height of the current duplicate, by referring to its autocropped version if the “Autocrop layer copies” checkbox is enabled.
- % of scaled duplicate extents:
as a percentage, respectively, of the width and the height taken by the current (and possibly autocropped) duplicate after being scaled.
- % of image extents:
as a percentage, respectively, of the width and the height of the current image.
- Pixel:
in pixels.
- Origin of coordinates
-
Lets you select the origin from which the coordinates of the rotation center of each layer copy are measured.
The available origins are: Upper left corner of original layer, Upper left corner of image.
- Shift rotation center with layer copies
-
When this box is checked, the rotation center will be shifted together with the layer copies, meaning that its horizontal and vertical coordinates will be progressively increased from time to time by the values specified, respectively, with the “Displacement in X direction” and “Displacement in Y direction” options.
The example below illustrates how the effect of the duplication changes according to whether this option is enabled or not, in case of simultaneous rotation and displacement of the duplicates.
- Step to start transforming from
-
Allows you to choose the stage of duplication from which the planned transformations (displacement, scaling, rotation) have to start, so as not to alter all the duplicates that precede the one generated at that step.
- Interpolation method
-
Lets you select the method of interpolation to use for transforming the layer copies.
The available methods are: None, Linear, Cubic, Lanczos.
- Stack duplicates
-
Allows you to decide whether to arrange the copies from bottom to top (Above each other) or from top to bottom (Below each other) in either the Layer or Channel Stack, so that each duplicate will appear, respectively, in front of or behind the previous one, as shown in the illustration below.
- Group layer copies
-
When this checkbox is activated, the layer copies will be put into a new layer group.
- Merge layer copies together
-
When this checkbox is activated, the layer copies will be eventually merged into a single layer.
Comments
Multi-Replicate: version 1.07 available
RELEASE NOTES
Multi-Replicate: version 1.06 available
RELEASE NOTES
Multi-Replicate: version 1.05 available
_RELEASE NOTES_
Drawable Multiplication: version 1.04 available
_RELEASE NOTES_
Drawable Multiplication: version 1.03 available
_RELEASE NOTES_
Drawable Multiplication: version 1.02 available
_ RELEASE NOTES _
* Now the script can offset the duplicates even when the original drawable is a channel.
* Forced the script to be inactive if there is a floating selection inside the image.
* Reshaped and cleaned up the code.
An idea
I love the script. It works great to create animations. I do have a question/idea/suggestion though. I do not know how to write scripts -- yet -- but was wondering if it is possible to set your script to follow a path? Instead of stroking to path with a brush, kind of stroking to path with the drawable multiplication script?
Thanks for your suggestion, nixine
Sorry for answering late, I didn't notice your comment until now.
I think your idea is very interesting. As soon as I get time, I will try to implement the functionality you suggest.
Thank you again.
Thank You, Gino
Works great for my perspective drawings. I'll be sure to find a multitude of other uses for this as well. :)
Good job!
Thanks for your comment, mahvin
I'm glad that you liked my script.