├── boys ├── bieber.jpg ├── captain.jpg ├── chris.jpg ├── dicap.jpg └── namjoon.jpg ├── girls ├── ariana.jpg ├── cardi.jpg ├── jennie.jpg ├── kaif.jpg ├── lisa.jpg ├── rihana.jpg ├── scarlet.jpg ├── selena.jpg └── watson.jpg ├── main.py └── my_valentine_day_date.jpg /boys/bieber.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/perfect_girlfriend/5dd587ae27b17d0366e79c13f1b3f1eb7fb73afe/boys/bieber.jpg -------------------------------------------------------------------------------- /boys/captain.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/perfect_girlfriend/5dd587ae27b17d0366e79c13f1b3f1eb7fb73afe/boys/captain.jpg -------------------------------------------------------------------------------- /boys/chris.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/perfect_girlfriend/5dd587ae27b17d0366e79c13f1b3f1eb7fb73afe/boys/chris.jpg -------------------------------------------------------------------------------- /boys/dicap.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/perfect_girlfriend/5dd587ae27b17d0366e79c13f1b3f1eb7fb73afe/boys/dicap.jpg -------------------------------------------------------------------------------- /boys/namjoon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/perfect_girlfriend/5dd587ae27b17d0366e79c13f1b3f1eb7fb73afe/boys/namjoon.jpg -------------------------------------------------------------------------------- /girls/ariana.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/perfect_girlfriend/5dd587ae27b17d0366e79c13f1b3f1eb7fb73afe/girls/ariana.jpg -------------------------------------------------------------------------------- /girls/cardi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/perfect_girlfriend/5dd587ae27b17d0366e79c13f1b3f1eb7fb73afe/girls/cardi.jpg -------------------------------------------------------------------------------- /girls/jennie.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/perfect_girlfriend/5dd587ae27b17d0366e79c13f1b3f1eb7fb73afe/girls/jennie.jpg -------------------------------------------------------------------------------- /girls/kaif.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/perfect_girlfriend/5dd587ae27b17d0366e79c13f1b3f1eb7fb73afe/girls/kaif.jpg -------------------------------------------------------------------------------- /girls/lisa.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/perfect_girlfriend/5dd587ae27b17d0366e79c13f1b3f1eb7fb73afe/girls/lisa.jpg -------------------------------------------------------------------------------- /girls/rihana.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/perfect_girlfriend/5dd587ae27b17d0366e79c13f1b3f1eb7fb73afe/girls/rihana.jpg -------------------------------------------------------------------------------- /girls/scarlet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/perfect_girlfriend/5dd587ae27b17d0366e79c13f1b3f1eb7fb73afe/girls/scarlet.jpg -------------------------------------------------------------------------------- /girls/selena.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/perfect_girlfriend/5dd587ae27b17d0366e79c13f1b3f1eb7fb73afe/girls/selena.jpg -------------------------------------------------------------------------------- /girls/watson.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/perfect_girlfriend/5dd587ae27b17d0366e79c13f1b3f1eb7fb73afe/girls/watson.jpg -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import glob 2 | import imagehash 3 | from PIL import Image 4 | 5 | my_img_url = './boys/bieber.jpg' 6 | my_hash = imagehash.average_hash(Image.open(my_img_url)) 7 | 8 | girls = glob.glob('./girls/*.jpg') 9 | selected = girls[0] 10 | accepted_diff = 1000 11 | for girl in girls: 12 | girl_hash = imagehash.average_hash(Image.open(girl)) 13 | diff = girl_hash - my_hash 14 | if diff < accepted_diff: 15 | selected = girl 16 | accepted_diff = diff 17 | 18 | bf_img = Image.open(my_img_url) 19 | gf_img = Image.open(selected) 20 | couple_img = Image.new('RGB', (bf_img.width + gf_img.width, bf_img.height)) 21 | couple_img.paste(bf_img, (0, 0)) 22 | couple_img.paste(gf_img, (bf_img.width, 0)) 23 | couple_img.save('my_valentine_day_date.jpg') 24 | couple_img.show() -------------------------------------------------------------------------------- /my_valentine_day_date.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProgrammingHero1/perfect_girlfriend/5dd587ae27b17d0366e79c13f1b3f1eb7fb73afe/my_valentine_day_date.jpg --------------------------------------------------------------------------------