Mohamed Amine Hajji / Projects

Evolving Artwork with Genetic Algorithms

Upload a photo and watch a population of colored polygons evolve, generation by generation, into a recognizable low-poly approximation — entirely client-side in the browser.

There’s no neural network here — the "intelligence" is entirely in the search. A population of individuals, each ~90 randomly placed translucent polygons, evolves generation after generation through tournament selection, crossover, and weighted mutation under a simulated-annealing schedule that shifts the search from coarse composition to fine detail. The highest-leverage piece sits on top: a hill-climbing pass that tests targeted local changes every generation and keeps only the ones that strictly improve fitness, biased toward whichever region is currently worst-matched — that error-guided placement was the single biggest visible improvement, taking a face from a featureless blur to two clearly resolved eyes in the same time budget.

Highlights

Stack: Angular, TypeScript, PrimeNG, Tailwind CSS