Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 1.74 KB

File metadata and controls

42 lines (29 loc) · 1.74 KB

Genetic algorithm image reconstruction

Script for reconstructing B&W images using random shapes placement

Installation

pip install -r requirements.txt

Genetic alghorithm key functions / parameters

Generation / population

One generation consist of n (default: 50) B&W images containing various shapes/texts

Crossover

Various functions for crossover:

  • blending (with alpha channel 0.5) (recommended)
  • random rows / columns swapping
  • Concatenating two halves together

Fitness function

Peak signal-to-noise ratio (PSNR) used as function to evaluate similarity of two images

Mutation

Mutate by adding number of random shape/text to image

Various art creation showcase

Showcase uses default options + various small tweaks. 7500 Generations Original image is 201 x 300px. Presentation below shows resized gifs to (134x200)

Original Original Original Original Original Original Original Original