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
- Host: GitHub
- URL: https://github.com/bishal0602/chaotic-canvas
- Owner: bishal0602
- Created: 2025-03-09T13:19:13.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-03-09T13:26:35.000Z (7 months ago)
- Last Synced: 2025-03-09T14:24:57.344Z (7 months ago)
- Topics: evolutionary-art, genetic-algorithm, go
- Language: Go
- Homepage:
- Size: 4.86 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# chaotic-canvas
![]()
![]()
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
```