Skip to content
Image generation via genetic algorithm.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This is an attempt at generating an output image from a source picture by mutating a group of semi-transparent polygons.

I wanted to do something similar to this:

animated gif of generated image generated image

The code is still very thrown together but it produces some acceptable results. Generating the image above took a couple of hours though so there's room for improvements.

I'd be happy to hear about ideas on how to improve the algorithm/code.

Install requirements

  • Create virtualenv

    virtualenv .
  • Install requirements

    bin/pip install -r requirements
  • (optional) PIL might have to be installed like this

    bin/pip install PIL --allow-external PIL --allow-unverified PIL --upgrade


  • Running the script

    bin/python src/ <path_to_img>

Use a small source image (e.g. with a maximum size of 512x512 pixels). The generated image files will be created in your system's temp directory.


You can’t perform that action at this time.