As I was wrapping up my triangular image evolution experiments, I was inspired by a couple of posts by my friend Mike McCarthy, a concept artist and fellow Fable veteran. The first post that piqued my interest was this dread-inducing Spider Queen he’d just finished colouring. Certainly the stuff of nightmares and a testament to his skills as an artist. The second link was to the work of Petros Vrellis, a Greek artist who mixes art with technology, in this case to recreate art masterpieces using only a circular loom and a single piece of thread. Looking at Petros’ work I wondered if I could take the image evolver and rework it to create circular line drawings, formed from a single continuous thread.
It turned out that this was conceptually very easy. The container that SFML (the library I use to perform rendering for me) uses to hold all the triangles, is the same one I would use to hold a list of lines. As its all just 2D geometry, you simply tell it that “this is a list of points on a continuous line” rather than “this is a list of points on a list of triangles”.
In terms of actual coding I took my VectorImageGeneticAlgorithm, created a base class that contained almost all its functionality, then created a new LineImageGeneticAlgorithm that inherited from that base-class and overrode just the CalculateFitness function, almost entirely because I was comparing in black and white rather than colour. I can’t remember exactly how long it took me, but I think maybe a couple of hours.
Once I’d gotten everything up and running, I took Mike’s Spider Queen image, cut it down to a sensible size (mostly so I could fit more images per texture on the GPU) and set it off. Fifteen hours and 30,000 lines later, this was the result (click images to expand):
It’s funny what evolution can work with and what it can’t. For preference, most people would focus detail on the face, but clearly the ruff and beads were a lot easier to optimise over. The spider abdomen looks clearly defined to us in the original image, but getting that same delineation using only greyscale lines that were fixed to the circular loom proved impossible. Still, it was a nice result and some of the detail was much better than I expected.
After playing about with the evolver for a while, I had an idea of how to animate images created with it, the results of which I shall share with you next time.