Okay, I have refactored the user interface to accept numerous commands related to the plot between, aka mosaic, image type. And, have refactored the type 41 image code to make use of the variables related to the new commands.

So, at least one more gallery (see below).

New User Interface Commands

The commands and variables I added are as follows. Some of them duplicate previous commands and variables. I will leave cleaning up the code for another day. No code being shown for the commands as it is simple and repetitive.

## these bw* relate to type 41 images, may rework type 40 and others to use them as well
# some of these variables are duplicating existing ones, but wanted to have a somewhat consistent naming convention
bw_a = 'x'    # e.g. bway
bw_dx = 1     # e.g. bwd2
bw_f = 'r'    # e.g. bwfa
bw_i = False  # e.g. bwi
bw_l = 'm'    # e.g. bwle
bw_lph = 1    # e.g. bwlph.78
bw_m = False  # e.g. bwm
bw_o = True   # e.g. bwo
bw_r = False  # e.g. bwrrr
bw_s = 32     # e.g. bws16
# bwa: x, y; set bw_a (choose axis to colour between; default: x)
# bwd: 1, 2; ... or 0 for random, set bw_dx (nbr of lines separation for btw_n_apart; default: 1)
# bwf: r, a; set bw_f (choose function: r -> btw_rnd, a -> btw_n_apart; default: r)
# bwi: ; toggle boolean module variable bw_i (use inverse on transformation matrix; default: n, False)
# bwl: s, e, m, r; set bw_l (base line for btw_rnd; default: m)
# bwlph: 0-1; set bw_lph (alpha for colour areas, default: 1)
# bwm: ; toggle boolean module variable bw_m (use colour area multipliers; default: n, False)
# bwo: ; toggle boolean bw_o (line overlap for btw_n_apart; default: y, True)
# bwr: y, n, r, rr: toggle bw_r (plot in reverse or random order; default: n)
# bws: 1, 2, 48; set bw_s (number of colour sections per plot between for any two data rows, default: 32)
##

And, a very minor refactoring of the image generating code. I probably should have gotten more creative and cut down on all those if blocks. Maybe down the road, as I do plan to completely refactor the spirograph code. Likely adding a few new modules as well. Will be a learning process I am sure.

if bw_f == 'r':
  if bw_a == 'y':
    print(f"\tbtw_rnd(..., bc='{bw_l}', r={bw_r}, fix=None, mlt={bw_m}, sect={bw_s}, alpha={bw_lph})")
    btw_rnd(ax, dstx, dsty, bc=bw_l, r=bw_r, fix=None, mlt=bw_m, sect=bw_s)
  else:
    print(f"\tbtw_rnd_x(..., bc='{bw_l}', r={bw_r}, fix=None, mlt={bw_m}, sect={bw_s}, alpha={bw_lph})")
    btw_rnd_x(ax, dstx, dsty, bc=bw_l, r=bw_r, fix=None, mlt=bw_m, sect=bw_s)
else:
  if bw_a == 'y':
    print(f"\tbtw_n_apart(..., dx={bw_dx}, ol={bw_o}, r={bw_r}, fix=None, mlt={bw_m}, sect={bw_s}, alpha={bw_lph})")
    btw_n_apart(ax, dstx, dsty, dx=bw_dx, ol=bw_o, r=bw_r, fix=None, mlt=bw_m, sect=bw_s)
  else:
    print(f"\tbtw_n_apart_x(..., dx={bw_dx}, ol={bw_o}, r={bw_r}, fix=None, mlt={bw_m}, sect={bw_s}, alpha={bw_lph})")
    btw_n_apart_x(ax, dstx, dsty, dx=bw_dx, ol=bw_o, r=bw_r, fix=None, mlt=bw_m, sect=bw_s)

There a great many images and they do add up to about 3.5 MB of download size. Sorry! And, I only used 1024 plotting points to try to keep things relatively small. For some of these I would, if thinking about printing at full size, use 2-4k plotting points. I have also reduced the number of colours in the PNG from full colour to 256 colours. This makes each individual image quite a bit smaller. But it does distort the background of the images which use many more individual colours.

Note: I am using lazy loading for the images, so if you don’t scroll down, you won’t load any more than the browser currently downloaded.

I have also used the same colour map for all the images. Perhaps not the best choice.

The base image is based on the following. Though because the wheel shape is a circle, only the widths are used for the circle radii.

wheels: 10 (Circle), k_f: 5, cgv: 4, points: 1024
widths: [1, 0.5092646387120655, 0.40837189463523244, 0.22764858813315933, 0.16277866605287283, 0.125j, 0.125j, 0.125, 0.125, 0.125j],
heights: [1, 0.738910118057744, 0.4888269632344673, 0.2538252500295064, 0.24899887203274657j, 0.22663856829736512, 0.17336544284026734, 0.17221196596740296, 0.125, 0.125],
freqs: [4, -11, -1, -11, -6, 9, 9, -11, 9, 9]

Here’s the base spirograph curve.

Type 2: basic spirograph image
spirograph images generated with 10 circles

Though a gnarly style image, you can see the underlying spirograph shape in the following.

Type 7: basic gnarly image
ln wd: 6, ln alpha: 0.92, ln drop: 3 (front)
spirograph images generated with 10 circles

And now a series of my first attempt to get a cycling line width in the images. Mostly a failed attempt. But, these are a case where I would typically use 2-4k data points to prevent the gap between the lines.

Type 10: simulated cycling line size
axis: x
spirograph with simulated cycling line width
Type 10: simulated cycling line size
axis: y
spirograph with simulated cycling line width
Type 10: simulated cycling line size
first attempt at orthogonal lines
spirograph with simulated cycling line width
Type 10: simulated cycling line size
2nd attempt at orthogonal lines
spirograph with simulated cycling line width

And here’s a few where I used scatter plots to simulate cycling line widths (a better result in general). Again more data points would look better.

Type 15: simulated cycling line width using scatter plot
sz_mult: 35, max size: 4480
spirograph with simulated cycling line width
Type 17: simulated cycling line width, random marker shape
sz_mult: 117, max size: 7488, marker: *
spirograph with simulated cycling line width

For this next one, I turned on my code attempting to generate a more symmetrical image.

Type 15: simulated cycling line width using scatter plot
do sym: True (10) => reverse 2nd, 4th, 6th, 8th, 10th, 12th, 14th and 16th sixteenths
sz_mult: 46, max size: 1472
spirograph with simulated cycling line width

I am thinking that did more or less work.

Here’s some variations on the full-gnarly.

Type 22: 'gnarly' plot subset (n, n-2, n-4, ...)
rows: [9, 7, 5, 3, 1] with symmetry/chaos disabled
plot subset of rows for gnarly type image
Type 23: plot subset (n, n-1, n-3, ...)
rows: [8, 6, 4, 2, 0]
plot subset of rows for gnarly type image

A fair bit of similarity in those two.

For the next one I turned on my code attempting to create chaos.

Type 25: randomly use 1/3 of wheel data for plot
sym 11: y data => reverse: [10 13 12 2 3 15 14 8], unchanged: [ 0 7 4 9 6 11 5 1]
gnarly style plot

Now applying some linear transformations to the gnarly curve. Any attempts at symmetry or chaos have been turned off. And, I did not extend the image boundaries to include the full range all of the curves.

Type 26: 'gnarly' curve with linear translations
translation values: [-144, -144, 144, 144], [144, -144, -144, 144]
gnarly style plot

Now let’s move onto some colour between images. The following few use my initial coding attempts.

Type 27: experiment colouring between various curve lines
between each data row in reverse
image generated using plot between functionality
Type 27: experiment colouring between various curve lines
btw_n_apart(dx=3, ol=True, r=False, fix=None, mlt=False, sect=1)
image generated using plot between functionality

Okay, some gnarly images with rotational transformations added.

Type 30: 'gnarly' curve with rotations
7 rotations, with symmetry attempt
image generated using plot between functionality
Type 30: 'gnarly' curve with rotations
16 rotations, with symmetry attempt
image generated using plot between functionality

All of the following use my latest image type: plot between images with linear and rotational transformations. The transformations are plotted in a random order. I am not going to show that order.

Type 41: plot between with affine transformations
16 transformations
btw_rnd(..., bc='m', r=False, fix=None, mlt=False, sect=32, alpha=1)
image generated using plot between functionality

Add some random area sizes.

Type 41: plot between with affine transformations
4 transformations
btw_rnd(..., bc='m', r=False, fix=None, mlt=True, sect=32, alpha=1)
multipliers: [1.8, 2.2, 2.4, 1.2, 1.4, 2.0, 1.6, 1.0, 1.0, 1.0]
image generated using plot between functionality
Type 41: plot between with affine transformations
4 transformations with chaos and multipliers enabled
btw_rnd(..., bc='m', r=False, fix=None, mlt=True, sect=32, alpha=1)
image generated using plot between functionality
Type 41: plot between with affine transformations
7 transformations with chaos and multipliers enabled
btw_rnd(..., bc='m', r=False, fix=None, mlt=True, sect=32, alpha=1)
image generated using plot between functionality
Type 41: plot between with affine transformations
7 transformations with added symmetry enabled
btw_rnd(..., bc='m', r=False, fix=None, mlt=False, sect=32, alpha=1)
image generated using plot between functionality

Let’s try a different function.

Type 41: plot between with affine transformations
5 transformations
btw_n_apart(..., dx=4, ol=False, r=False, fix=None, mlt=False, sect=32, alpha=1)
image generated using plot between functionality
Type 41: plot between with affine transformations
5 transformations with multipliers enabled
btw_n_apart(..., dx=4, ol=False, r=False, fix=None, mlt=True, sect=16, alpha=1)
image generated using plot between functionality
Type 41: plot between with affine transformations
6 transformations with chaos and multipliers enabled
btw_n_apart(dx=4, ol=False, r=False, fix=None, mlt=True, sect=16)
image generated using plot between functionality

Done

That’s it for this one. And I think, very likely, for this series on me playing with digital spirograph type curves.

My apologies, just realized I didn’t do any colour between images along the x data rows, just the y data rows. Old age I expect.

Until next time, may you find peace at the keyboard.