Berry van Someren
Software Engineer

Drarwing: Darwinian Drawing

2022

We use the principles of reproduction, mutation and survival of the fittest to evolve beautiful images. Drarwing can use different brush sets to produce outputs in different styles. The code can be found on GitHub.

(This image might load slowly) This GIF shows how Drarwing simulates a painting process, working from large and rough shapes, iteratively adding more detail.

Gallery

Some examples of results. All original images are from unsplash.com

These images are 4K so make sure to click them to open them at full size!

Evolution of Images

Darwin defined evolution as "descent with modification". DNA defines a specimens properties. Specimen whose properties better fit their environment produce more offspring. Offspring receives a mix of genes from its parents, and differs even further through mutations in their DNA.

We can use a similar process to achieve arbitrary goals as long as we modify our definitions of these three rules appropriately. In this project "fitness" simply measures how well an image approximates a target image. The DNA of our image defines what brush strokes to make on a canvas to paint the image. Every mutation could add a brush stroke to our image, or change the properties of an already existing brush stroke.

Tricks I have used to speed up convergence of this Painting algorithm, and improve looks include; using the differences with the target image to further guide the area of mutation, using the magnitude of the overall differences to scale modifications, and using the gradient of the target image to guide the direction of brush strokes. However, instead of optimizing perfectly, we embrace the random number generator, and allow it to select suboptimal modifications in order to achieve a more artsy effect.