Photogrowth: Ant Painting

Photogrowth is an evolutionary system that generates non-photorealistic renderings of images. A painting algorithm, inspired on ant colony approaches, produces emerging renders by simulating artificial ants that travel on a canvas. The trails of the ants are represented by continuous lines, working like paintbrushes. The superimposition and intertwinement of all trails, together with their variation in direction, width, and colour, produce expressive renderings from a given image that would be hard to execute or even imagine.

The artificial ants live in a two-dimensional environment initialised with the input image and paint on a canvas that is initially empty and used exclusively for depositing ink. In the environment, the brightness level of a given area determines the available energy at that point. The ants gain energy by traveling through those areas with energy. The energy that the ants gain is removed from the environment. If the energy of an ant is below a given threshold it dies; and if it is above a given threshold it generates offspring. Each ant has a set of sensory vectors that return the energy value of the surrounding areas. Each sensory vector has a specific direction, length, and weight. The different settings related to the sensory capabilities, life span, reproduction rate, free will, etc. are defined by a wide range of parameters that, when changed, allow the creation of different types of imagery.


The rendering algorithm is able to export scalable vector graphics, allowing the creation of resolution independent paintings. The list of circles in each trail is converted into a line of variable widths. The algorithm deals with self intersecting lines and enables the specification of additional rendering options, including its fill opacity and colour, as well as the opacity, colour and width of the outline.

Screenshot of the first version of Photogrowth
Figure 1

Screenshot of the first version of Photogrowth


Photogrowth started as a simple generative art system. However, the number of parameters controlling the behaviour of the ants and their interdependencies soon revealed to be too large to allow their fine-tuning by hand. Hence, the resulting renderings revealed that we were not exploring all the creative possibilities allowed by the algorithm. To tackle this problem, we adopted an interactive genetic algorithm to evolve the wide set of parameters that control the behaviour of the ants.

Later, to overcome some of the limitations of user-guided evolution, we explored a meta-level interactive art approach where the users could express their intentions and goals through the design of fitness functions. The ideia is simple: take users out of the evolutionary loop and allow them to design a fitness function that ideally guides evolution towards results that are consistent with their intentions without the need to perform individual assessments. To this end, statistics describing the behaviour of the ants are gathered while they paint, and image metrics are calculated once each painting is completed. These behavioural statistics and image metrics are the basis for the construction of fitness functions designed by the users as the functions indicate the characteristics to be pursued and avoided. An intuitive and responsive interface was designed to allow the users to perceive the semantics associated with each characteristic and feature.

Screenshot of the fitness design interface
Figure 2

Screenshot of the fitness design interface. See video at


Same image rendered by the same ant species
Figure 3

Same image rendered by the same ant species.


Users begin by designing a fitness function. Then they pass control to the evolutionary engine. Each genotype (ant species) encodes the parameters that determine the behaviour the ants. Each phenotype (painting) is produced by simulating the ants. When the evolutionary runs are finished, we further empower users by letting them select their favourite images among the diversity of outcomes that address their intentions, apply the associated genotypes to different input images, and control the details of the final rendering. Thus, the ability to specify the characteristics of the ants species, as well as the rendering details, empowers the users by allowing him to generate a wide variety outcomes consistent with their artistic intentions.

Screenshot of the rendering interface
Figure 4

Screenshot of the rendering interface. See video at


Same image rendered by the same ant species but different final rendering options
Figure 5

Same image rendered by the same ant species but different final rendering options.


One of the advantages of the system is the possibility of applying an evolved ant species to different input images. The species tend to be robust and thus able to survive in these different environments, producing ant paintings that are characteristic of the species.

Different images rendered by the same ant species
Figure 6

Different images rendered by the same ant species.


More recently, we wanted to exhibit the creative potential of this work. So we developed insta.ants — artsy artificial ants that paint unique antworks from Instagram posts. A computer bot systematically collects images from Instagram tagged with #instaants, supplies them to the painting ants, and exhibits the resulting antworks on their Instagram profile as well as on the repository at, where you can also find videos of their painting processes. Mode information can be found at

Screenshot of the Insta.ants profile
Figure 7

Screenshot of the insta.ants profile.




  • The paper “An Interface for Fitness Function Design” by Penousal Machado, Tiago Martins, Hugo Amaro and Pedro H. Abreu has won the best paper award at EvoMUSART 2014.


Presence in exhibitions


  • Living Machines exhibition, London Science Museum, London, UK (August 1, 2013).
  • BRIDGES 2012 – Mathematical Art Galleries, Towson, MA, USA, 2012.


Related projects




  • T. Barrass, A. Eldridge, G. Greenfield, C. Jacob, P. Machado, N. Monmarché, Y. Semet, F. Durand, U. O’Reilly, D. Shiffman, and P. Urbano, “Gallery Artists,” Leonardo, vol. 47, iss. 1, pp. 8-16, 2014.

In Proceedings

  • P. Machado, T. Martins, H. Amaro, and P. H. Abreu, “An Interface for Fitness Function Design,” in Evolutionary and Biologically Inspired Music, Sound, Art and Design – Third International Conference, EvoMUSART 2014, Granada, Spain, April 23-25, 2014. Proceedings, 2014.

  • P. Machado and H. Amaro, “Fitness Functions for Ant Colony Paintings,” in Proceedings of the fourth International Conference on Computational Creativity (ICCC), 2013, pp. 32-39.

  • P. Machado and L. Pereira, “Photogrowth: non-photorealistic renderings through ant paintings,” in Genetic and Evolutionary Computation Conference, GECCO ’12, Philadelphia, PA, USA, July 7-11, 2012, 2012, pp. 233-240.


Tiago Martins

Hugo Amaro

Luís Pereira