How bishal0602/chaotic-canvas works
Project Type and Purpose
• chaotic-canvas is a CLI tool (monolithic Go application) that implements a genetic algorithm to evolve random images toward a target image.
• Its purpose is to demonstrate and experiment with genetic operations (selection, crossover, mutation) in the domain of image processing.
File Structure Analysis
• Top-level:
• main.go: entry point, CLI flag parsing, orchestration
• config/config.go: CLI argument loader and validation
• genetic/: core GA engine (algorithm.go, individual.go, selection.go, crossover.go, mutation.go)
• imageio/: image I/O, resizing, compression utilities
• mathutil/: random number generation, numeric helpers
• assets/, examples/: static resources (target images, samples)
• Patterns:
• Layered/Modular – CLI layer, GA engine layer, utility layer
• Pipeline-style within GA: init → fitness → selection → crossover → mutation → replacement → termination
README Insights
• Shows high-level flowchart of the GA loop
• Describes each GA phase (initialization, fitness, selection, crossover, mutation, replacement, termination)
• Lists command-line flags, default values, and expected outputs