Inspired by @alteredq
Task here is using a simulated annealing approach to draw an image by overlapping many primitive polygons of various colors.
The implementation; starting with a random N polygons; It, then, randomly modifies one parameter at a time and calculates how close it is to the original. Lastly, if it looks closer to the original, it will accept the change and repeat the whole process again.
To determine how close it is to the origin, it computes sum of pixel-by-pixel differences as a fitness value. Lower differences, Closer it is
This technique can be seen as genetic programming. A random N polygons is represented by a random DNA string. The changing can be formulated as gene mutation process. The goal is to survive under a condition that DNA that produces a closer image is likely to survive more