EARP is a program that uses evolutionary algorithm techniques to recreate an image using a limited number of semi-transparent polygons. The recreation images you see above has just 100 polygons in it!.
EARP is a spin-off from a second year University project that I felt deserved a bit more than what was on the brief.
The original project used the DEAP library and was implemented in python. The tuning of variables and for efficiencies was calculated using this implementation but, in car parlance, there's no replacement for displacement.
So a rewrite in Golang commenced and this is what I present to you.
git clone https://github.com/LukeBriggsDev/EARP
cd EARP
go get
go build
evolution.mp4
earp image_path no_of_polygons no_gens
earp images/darwin.png 100 1000
Here are some results after running the algorithm for 10,000 generations (Approx. 10 minutes on an 8-core M1 Pro) and limiting solutions to less than 100 polygons.
Generations: 10,000
Fitness: 97.1%
Generations: 10,000
Fitness: 95.2%
Here is a slightly harder image that was run for 20,000 generations
Generations: 20,000
Fitness: 94.8%