Average Pursuit


This image has been generated by running the Average Pursuit algorithm, described here below.

The Average Pursuit algorithm is an extension of the Greedy Spaghetti Pandemonium algorithm and tries to make the greedy traversal dwell longer in local areas, in order to smoothen the colour transitions.

The approach consists of selecting, at each step and both from pixels and colours, the closest neighbour to a moving average position, rather than the closest neighbour to the current position.

The exponential moving average is adopted and all coordinates (row, column, red, green and blue) are revised at the same rate, in the range 0% to 100% (0.0 to 1.0):

New Average = Rate * New Sample + (1.0 - Rate) * Current Average

At a rate of 100%, the average position matches the current position and the algorithm behaves as per Greedy Spaghetti Pandemonium.

At a rate of 0%, the average position is fixed and matches the starting position so that the algorithm generates concentric gradients around the starting position.

In between 0% and 100%, my experimental implementation generates a variety of images with evolving characteristics, the most noticeable ones being that from 100% to 0% the paths transition from random to (somewhat counter-intuitively) straight, and their width increases.

This image in particular is generated using a rate of 50% to capture an intermediate stage where the walks keep suddenly changing between random, semi-straight diagonal and straight horizontal/vertical.

Implementation Note - The Average Pursuit algorithm can be extremely slow, especially at low rates. To calculate the nearest pixels and colours, the algorithm operates an R-Tree data structure, holding into that structure only items from the evolving frontier, instead of all the unreached items.

Image Licence: Public Domain (CC0).



Dimensions4,096 × 4,096