It is currently Tue Jul 28, 2026 12:41 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 44 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Replicate-in-rings
PostPosted: Thu Apr 09, 2015 9:00 pm  (#1) 
Offline
Script Coder
User avatar

Joined: Dec 27, 2014
Posts: 508
A few days ago I came across an old thread wherein somebody was asking for a script to produce this sort of pattern:
Image
(NB. This is not a tiled pattern - it may look like it at first glance ..that's what everybody says - use the Symmtery Tile plugin or GMIC ..but it's not tiling! )

The difference between tiling and this "concentric-rings" pattern can easily be seen in this example where the motif is itself a hexagon:
Image

The pattern is produced simply by replicating the motif at regular intervals around the circumferences of concentric circles. The rings are equally spaced and so, if there are 6 motifs in the first ring, there will be 12 in the second, 18 in the third and so on. This is simple high-school trigonometry, nothing more complex.

Strangely enough, there still doesn't seem to be any off-the-shelf way of producing this pattern even now, so I have adapted another script for this purpose and it turns out to have some rather interesting capabilities according to the parameters you choose, which I describe and illustrate below.

The script will work upon a selection of a layer, if there is one, else upon the whole layer.
(For best results, prepare your motif on a transparent background.)

Enjoy.

------------------------------------------------------------------------------------------------------------------
Parameters
==========

Replication radix
This is the fundamental parameter of the pattern - the number of repeats in the first ring from the centre.
If "Replication radix"=6, there will be 6 motifs in the first ring, 12 in the second, 18 in the third and so on.
The script will allow values from 1 to 20, but values in the range 4 to 8 seem to produce the best results.
(Lower values just produce rather odd results, much higher values just produce distinct rings.)

Number of rings
The number of rings to produce. The script will allow up to 30 rings ..but be warned it can take a very long time to render high values, depending upon the size of the input layer/selection.

Ring spacing
The nominal spacing between rings.
For "distinct" patterns (such as the dots pattern above), this should generally be set to a value greater than the maximum dimension of the motif.
Lower values will cause motifs to overlap, which can produce a number of interesting compositing effects (see "Gallery").
This value may be modified by the zoom (see below).

Offset angle
By default, the script will render each ring clockwise from the middle right side (ie. the "3 o'clock position"). This may leave a "seam" in this direction if the motifs overlap. You can adjust the alignment of the pattern by setting the Offset angle.
eg. if Offset angle=-90, the script will render each ring from the middle top (ie. the "12 o'clock position").
Use in conjunction with the Replication radix to change the alignment of the pattern.
eg. if radix=6, setting Offset angle to -30 or 30 will change the hexagon in the centre of the pattern from having a flat edge at top to having a vertex at top.

Progressive offset
By default, the script will produce concentric circles. However, if you set the Progressive offset (X,Y) values to non-zero, the rings will be offset progressively by the specified distance, starting from the centre. This can yield "lop-sided", "clumped" or "shock effect" patterns.

Zoom
By default, the script replicates the motif with the same size and ring-spacing throughout the pattern.
If you set the "Zoom at centre" and "Zoom at outer ring" to values other than 1.00, the script will scale the motif accordingly.
Also, if you check the "Zoom-adjust ring-spacing" option, the script will adjust the spacing between the rings progressively in accordance with the motif size.
This can yield a number of effects, especially when used in conjunction with the "Progressive offsets".

Central motif
If unchecked, the script will not include the motif in the central position of the pattern (ring 0). This is useful for generating rotationally-symmetic patterns.

Rotate motifs
If enabled, the motif will be rotated by the same angle as it's position from the centre of the pattern - this means that the same part of the motif will always be towards the centre of the pattern and yields a rotational symmetry to the overall pattern.

Outer rings uppermost
If the replicated motifs overlap, setting this option will cause the outermost rings to appear above the inner rings (rather than the usual centre-at-top). This can yield dramatically different results when overlapping motifs.

------------------------------------------
Additional Effects
=============

Iteration
----------
You can achieve more intricate composition effects by using the output from one run of the script (eg with radix=6,rings=5) as input motif to another run of the script with similar values, adjusting ring-spacing as necessary.

Seam-mending
-------------------
As mentioned above (under "Offset angle"), the script will render each ring clockwise from the middle right side (ie. the "3 o'clock position") by default. This may leave a "seam" in this direction if the motifs overlap, as the last motif in the ring is overlaid onto the first instead of being "tucked underneath".
You can rectify this problem manually after the running the script
For patterns which have rotational symmetry, you can use the duplicate-rotate-merge method of seam-mending:
- merge visible layers (if not already merged)
- duplicate the layer
- rotate duplicate layer 180 degrees
- add layer mask
- use the blend tool with gradient "FG to BG (RGB)", default colors (FG = black, BG = white), drag across the mask layer from just left of centre to just right of centre - the seam should "magically disappear"
- merge down

For patterns which do not have rotational symmetry, run the script a second time on the original motif, this time setting "Offset angle"=180, merge down (if not already) overlay onto first output, add layer mask and blend as above.

------------------------------------------------------------------------------------------------------------------
Gallery
=======

Basic Patterns
------------------
The following patterns were produced using a simple 30px black-filled circle on a transparent background as motif, ring-spacing=40, other settings as default (except radix):

Radix=4: Image Radix=5: Image Radix=6: Image
Radix=7: Image Radix=8: Image

With Radix=6, Rings=5, Ring-spacing=35, Zoom at centre=1.0, Zoom at outer ring=0.5, Zoom-adjust ring-spacing=Yes:
Image
Ditto, but Progressive offset X=6:
Image
With Radix=6, Rings=5, Ring-spacing=30, Zoom at centre=0.5, Zoom at outer ring=1.0, Zoom-adjust ring-spacing=Yes:
Image
Ditto, but Progressive offset X=6:
Image

----------------------
The following patterns were produced using Oregonian's multi-color hypocycloid image (viewtopic.php?f=23&t=11961) as motif:
Image
Radix=6, rings=3, Rotate motifs=Yes, (other settings as default):
Image
Ditto, script iterated:
Image
Ditto, colorized:
Image

As first above, but Outer rings uppermost=Yes (and seam-mended):
Image
Ditto, iterated:
Image

As first above, but rings=7:
Image

Radix=6, rings=7, Zoom at centre=1.00, Zoom at outer ring=0.30, Zoom-adjust ring-spacing=No, Rotate motifs=Yes, (other settings as default):
Image
Ditto, but Progressive offset X=20:
Image
Ditto, but Outer rings uppermost=Yes (and seam-mended)
Image

Radix=6, rings=7, Zoom at centre=0.50, Zoom at outer ring=1.00, Zoom-adjust ring-spacing=Yes, Rotate motifs=Yes, (other settings as default):
Image
Ditto, but Outer rings uppermost=Yes (and seam-mended)
Image
-----------------------------------------------------------------------
Some other images created with this script:
Image Image Image Image
Image Image Image Image
Image Image Image
Image Image
Image
Image

This classic "wagonwheel effect" is in fact just 5 frames with all the dots in a fixed pattern, rotating just 14.4 degrees anti-clockwise between each frame. But because of the relative spacing of the dots, the eye interprets the outer rings as revolving clockwise, and at different rates.
Image
------------------------------------------------------------------------------------------------------------------
Installation
============

Download the attached file, unzip, copy the file JT-replicate-in-rings.scm to your personal scripts folder:
Linux: ~/.gimp-2.8/scripts
Windows: C:\WINDOWS\Users\<name>\.gimp-2.8/scripts

Start Gimp or do "Filters>Refresh scripts" and you should find a new menu entry "Filters>Misc>JT Replicate in Rings"
Attachment:
JT-replicate-in-rings-v1-1.scm.zip [3.32 KiB]
Downloaded 416 times


Last edited by jontait2 on Thu Apr 09, 2015 11:39 pm, edited 1 time in total.

Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Replicate-in-rings
PostPosted: Thu Apr 09, 2015 9:54 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: Nov 16, 2011
Posts: 5127
Location: Metro Vancouver, BC
This script is awesome jontait2!
You're a Wizard :wizwand

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Top
 Post subject: Re: Replicate-in-rings
PostPosted: Thu Apr 09, 2015 9:59 pm  (#3) 
Offline
Script Coder
User avatar

Joined: Dec 27, 2014
Posts: 508
Glad you like it, Odin.
Please show us any good results you get!


Top
 Post subject: Re: Replicate-in-rings
PostPosted: Thu Apr 09, 2015 10:57 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Nov 16, 2011
Posts: 5127
Location: Metro Vancouver, BC
Well your examples look awesome, my attempt not so much. I must be doing something wrong.
I have an 800px transparent square background, a new layer with a 16px dot. When I run the script nothing seems to happen. Sometimes a get a new layer. Does the dot layer boundary size matter? Is a selection required?
There is a good chance I'm tired and/or a dunce.

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Top
 Post subject: Re: Replicate-in-rings
PostPosted: Thu Apr 09, 2015 11:09 pm  (#5) 
Offline
Script Coder
User avatar

Joined: Dec 27, 2014
Posts: 508
It should work like that, just rather slow ..the input layer is unnecessarily large so Gimp has a lot of extra processing to do. I've just tried it with those same parameters and it worked for me (Gimp 2.8.14 on Ubuntu 14.04 LTS 64bit).
And no, you don't have to have a selection - if there is a selection it will use that selection as base motif, if not it will use the whole of the active layer as motif.
I'd say try it again with a smaller layer size. Also try using a selection from some arbitrary image.


Top
 Post subject: Re: Replicate-in-rings
PostPosted: Thu Apr 09, 2015 11:11 pm  (#6) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
my image
Image
my settings
Image
my result
Image
my error

Quote:
JT Replicate in Rings Warning
Error while executing script-fu-JT-replicate-in-rings:

Error: ( : 1) eval: unbound variable: pi


GIMP Warning
Plug-In 'JT Replicate in Rings' left image undo in inconsistent state, closing open undo groups.


_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Replicate-in-rings
PostPosted: Thu Apr 09, 2015 11:24 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Nov 16, 2011
Posts: 5127
Location: Metro Vancouver, BC
I forgot to check the errors, here's mine.
Quote:
JT Replicate in Rings Warning
Error while executing script-fu-JT-replicate-in-rings:

Error: (<unknown> : 154194524) eval: unbound variable: pi

GIMP Warning
Plug-In 'JT Replicate in Rings' left image undo in inconsistent state, closing open undo groups.

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Top
 Post subject: Re: Replicate-in-rings
PostPosted: Thu Apr 09, 2015 11:40 pm  (#8) 
Offline
Script Coder
User avatar

Joined: Dec 27, 2014
Posts: 508
Okay, sorry about that folks.
Both "pi" and "*pi*" are defined on my systems, i don't know why they're not on yours.
Anyway, I've changed the script to use a built-in definition.
Please delete the first copy of the script, download again from my first post and try again.
Cheers.


Top
 Post subject: Re: Replicate-in-rings
PostPosted: Fri Apr 10, 2015 12:24 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: Nov 16, 2011
Posts: 5127
Location: Metro Vancouver, BC
jontait2, So far so good with v1.1. Here's my first two using defaults, (Wilber is from a brush). I'll test variables tomorrow.

Image

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Top
 Post subject: Re: Replicate-in-rings
PostPosted: Fri Apr 10, 2015 1:31 am  (#10) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
Thanks!

Image

Image

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Replicate-in-rings
PostPosted: Fri Apr 10, 2015 1:47 am  (#11) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12817
Pretty darn cool jontait2. :)


Attachments:
mace_ball.png
mace_ball.png [ 473.99 KiB | Viewed 3331 times ]

_________________
Lyle

Psalm 109:8

Image
Top
 Post subject: Re: Replicate-in-rings
PostPosted: Fri Apr 10, 2015 1:56 am  (#12) 
Offline
Global Moderator
User avatar

Joined: Oct 02, 2014
Posts: 5007
Location: Sydney Australia
I have just finished telling Ofnuts that some of us are happy to be GIMP 'time wasters' - so for my first attempt I used one of Molly's fish brushes as the motif and just clicked a few settings randomly to see what happened, then changed to separate colours to each layer -

Image

Terrific script Jontait2, and given your examples and Lylejk's post there is obviously so much more for me to explore! :tyspin

_________________
Image

Respect should be offered freely but hard earned


Top
 Post subject: Re: Replicate-in-rings
PostPosted: Fri Apr 10, 2015 2:01 am  (#13) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12817
I like it OMG. Anyway, why not another one. :)


Attachments:
glass_ball.png
glass_ball.png [ 1.7 MiB | Viewed 3327 times ]

_________________
Lyle

Psalm 109:8

Image
Top
 Post subject: Re: Replicate-in-rings
PostPosted: Fri Apr 10, 2015 2:19 am  (#14) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12817
Used a rotate n-copy lightening brush for the dandelion. :)


Attachments:
dandelion.png
dandelion.png [ 527.33 KiB | Viewed 3321 times ]

_________________
Lyle

Psalm 109:8

Image
Top
 Post subject: Re: Replicate-in-rings
PostPosted: Fri Apr 10, 2015 2:26 am  (#15) 
Offline
Global Moderator
User avatar

Joined: Oct 02, 2014
Posts: 5007
Location: Sydney Australia
Thanks Lylejk, and as you say why not another one; just what I wanted a paper doily, created using the 'iterative' process described by Jontait2 ...!!

Image

_________________
Image

Respect should be offered freely but hard earned


Top
 Post subject: Re: Replicate-in-rings
PostPosted: Fri Apr 10, 2015 3:02 am  (#16) 
Offline
Script Coder
User avatar

Joined: Dec 27, 2014
Posts: 508
Glad to see you got it going guys.
I'm sure there's plenty more possibilities to be explored with this little script - I've done most of my testing with radix=6, but values 4,5,7 and 8 all yield some quite interesting effects.


Top
 Post subject: Re: Replicate-in-rings
PostPosted: Fri Apr 10, 2015 4:52 am  (#17) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
If you want a feature request...

How about making the zoom adjustment non-linear.

At present you are doing a linear interpolation for each successive zoom factor, with the result that Lyle's "3D" creations look like cones rather than spheres. If you were to optionally use a sinusoid calculation instead you'd get a more spherical outcome.

Kevin


Top
 Post subject: Re: Replicate-in-rings
PostPosted: Fri Apr 10, 2015 5:19 am  (#18) 
Offline
Script Coder
User avatar

Joined: Dec 27, 2014
Posts: 508
Yes, noted. I do in fact have routines for trig funcs and cubic-bezier speed curves for animation, so I will look into porting those in a later version.


Top
 Post subject: Re: Replicate-in-rings
PostPosted: Fri Apr 10, 2015 11:36 am  (#19) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6946
Location: Somewhere in GIMP
Nice! :bigthup
Image
Image



_________________
Image


Top
 Post subject: Re: Replicate-in-rings
PostPosted: Fri Apr 10, 2015 3:59 pm  (#20) 
Offline
GimpChat Member
User avatar

Joined: Mar 10, 2014
Posts: 845
great filter and well explained! Thanks Jontait2
here my tests
Image

Image


Top
Post new topic Reply to topic  [ 44 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group