GA Pixel Art Generator A genetic algorithm implementation that evolves pixel art by attempting to recreate a target image through evolutionary computation. The program generates an animated GIF showing the evolution process from random noise to the final approximation. Demo Original Image Generated GIF Details This project uses a genetic algorithm to evolve RGB pixel values for each position in a 100x100 image grid. Each pixel is represented by a chromosome containing binary genes for red, green, and blue color channels. Through selection, crossover, and mutation operations, the algorithm iteratively improves the image quality to match a target image. Genetic Algorithm Parameters const IMG_SIZE: usize = 100 ; // Image dimensions (100x100) const POPULATION_SIZE: usize = 6 ; // Population size per pixel const ITERATION: usize = 50 ; // Number of generations const MUTATION_RATE: f64 = 0.05 ; // Bit-flip mutation probability const CROSSOVER_RATE: f64 = 0.8 ; // Crossover probability const GENE_LENGTH: usize = 8 ; // Bits per color channel const RGB_CHANNELS: usize = 3 ; // Red, Green, Blue channels const TOURNAMENT_SIZE: usize = 3 ; // Tournament selection size const ELITE_SIZE: usize = 2 ; // Number of elite individuals preserved Usage Prerequisites Add these dependencies to your Cargo.toml: [dependencies] image = " 0.24 " rand = " 0.8 " gif = " 0.12 " Running the Program # Place a target image named target.png in the project directory. cargo run Output Files
First seen: 2025-07-06 18:24
Last seen: 2025-07-06 19:24