An open API service indexing awesome lists of open source software.

https://github.com/bishal0602/chaotic-canvas

Genetic algorithm based image evolution that iteratively refines images to match a target
https://github.com/bishal0602/chaotic-canvas

evolutionary-art genetic-algorithm go

Last synced: 7 months ago
JSON representation

Genetic algorithm based image evolution that iteratively refines images to match a target

Awesome Lists containing this project

README

          

# chaotic-canvas


Target Image
       
Evolution Process

Chaotic Canvas uses genetic algorithms to evolve images. The idea is to start with a population of random images and gradually improve them to resemble a target image as closely as possible. It does this by applying genetic operations (selection, crossover, and mutation) over multiple generations to iteratively improve the population over multiple generations.

## Installation

1. Clone the repository:
```sh
git clone https://github.com/bishal0602/chaotic-canvas.git
cd chaotic-canvas
```

2. Install dependencies:
```sh
go mod tidy
```

3. Run the main program:
```ps1
go run . -target= -out= -pop= -gen= -mut=

```

## Code Structure

```
main.go
genetic
╰─ algorithm.go # Main logic of GA.
╰─ individual.go # Defines `Individual` struct and methods.
╰─ crossover.go # Implements crossover strategies.
╰─ mutation.go # Mutation strategies and adaptive mutation.
╰─ selection.go # Selection strategy for parents.
config
╰─ config.go
utils
╰─ color.go
╰─ file.go
╰─ maths.go
```