I tried to apply genetic algorithm on image. The original photo is 300*450, which means if I want to generate the exact photo, I need to get 1 from 300*450*3*255 cases. That’s why I only took the red value and also made the image pixelated.
In order to have a better performance, I also changed the mutate function a little bit to avoid decreasing accuracy by only mutating the wrong genes.
Source code is available on Github