Skip to content

Easy to modify script containing genetic alghoritm for B&W image reconstruction using random shapes/text drawings

License

Notifications You must be signed in to change notification settings

Th3NiKo/Genetic-algorithm-image-reconstruction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Easy to modify script containing genetic alghoritm for B&W image reconstruction using random shapes/text drawings

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages