About Genetic Painter

Genetic Painter is a free, open-source creative tool that demonstrates the power of evolutionary algorithms through visual art. Built as a browser-based application, it lets anyone experiment with genetic optimization in an intuitive and visually engaging way — no installation, no sign-up, no cost.

The Project

The idea behind Genetic Painter is simple: can a computer create a recognizable painting using nothing but random shapes and the principle of natural selection? The answer, as it turns out, is a resounding yes.

By placing random geometric shapes — circles, triangles, squares, or stars — onto a blank canvas and keeping only those that make the canvas look more like a target image, a detailed painting emerges from pure randomness. It's a hands-on demonstration of how powerful simple evolutionary rules can be when applied over thousands of iterations.

How It's Built

Genetic Painter is intentionally simple in its architecture. The entire application consists of vanilla HTML, CSS, and JavaScript — no frameworks, no build tools, no external dependencies. This keeps the app fast, lightweight, and accessible to anyone with a modern web browser.

The core algorithm uses the HTML5 Canvas API for pixel-level image manipulation. Each candidate shape is drawn onto a canvas, compared against the original image using Euclidean color distance, and either accepted or rejected based on whether it improves the overall similarity. The application runs entirely client-side, meaning your images never leave your device for processing.

Educational Value

Genetic Painter is particularly useful for students and educators exploring topics in:

Watching the algorithm work in real time provides an intuitive understanding of concepts that can otherwise feel abstract in a textbook.

Open Source

Genetic Painter is open source. Developers, students, and researchers are welcome to explore the code, suggest improvements, or adapt it for their own projects and experiments.

Contact

Genetic Painter is developed and maintained as an independent project. If you have feedback, questions, or suggestions, you can reach out through the project's GitHub repository.