diff --git a/assets/alphabet-complete.jpg b/assets/alphabet-complete.jpg new file mode 100644 index 0000000..dc67354 Binary files /dev/null and b/assets/alphabet-complete.jpg differ diff --git a/assets/blue.png b/assets/blue.png new file mode 100644 index 0000000..6dca6ca Binary files /dev/null and b/assets/blue.png differ diff --git a/assets/green.png b/assets/green.png new file mode 100644 index 0000000..5f5e5c6 Binary files /dev/null and b/assets/green.png differ diff --git a/assets/red.png b/assets/red.png new file mode 100644 index 0000000..3af6c80 Binary files /dev/null and b/assets/red.png differ diff --git a/assets/white.png b/assets/white.png new file mode 100644 index 0000000..b26bb09 Binary files /dev/null and b/assets/white.png differ diff --git a/assets/yellow.png b/assets/yellow.png new file mode 100644 index 0000000..5a2d098 Binary files /dev/null and b/assets/yellow.png differ diff --git a/main.py b/main.py index 9d6bf1d..ef74989 100755 --- a/main.py +++ b/main.py @@ -4,35 +4,27 @@ from __future__ import print_function from wand.image import Image from wand.drawing import Drawing from wand.color import Color - +from wand.display import display def main(): colors = ['red', 'green', 'blue', 'yellow'] special_cards = ['W', 'N'] for color in colors: - for i in range(1, 14): - draw_card_face_number(color, i) + for i in range(1, 4): + draw_card_face(color, i) for sign in special_cards: - draw_card_face_special('white', sign) + draw_card_face('white', sign) -def draw_card_face_number(color, symbol): +def draw_card_face(color, symbol): with Image(filename='assets/wozard-card.png') as img: img = draw_symbol(img, symbol, color, 90, 130) img = draw_symbol(img, symbol, color, int(img.width - 90), 130) - img.flip() - img = draw_symbol(img, symbol, color, 90, 130) - img = draw_symbol(img, symbol, color, int(img.width - 100), 130) - img.save(filename='output/card-{}-{}.png'.format(color, symbol)) - -def draw_card_face_special(color, symbol): - with Image(filename='assets/wozard-card.png') as img: - img = draw_symbol(img, symbol, color, 90, 130) - img = draw_symbol(img, symbol, color, int(img.width - 90), 130) - img.flip() + img.flip() # Make mirrored text img = draw_symbol(img, symbol, color, 90, 130) img = draw_symbol(img, symbol, color, int(img.width - 100), 130) + img = draw_rune(img, color) img.save(filename='output/card-{}-{}.png'.format(color, symbol)) def draw_symbol(img, symbol, color, x, y): @@ -43,7 +35,15 @@ def draw_symbol(img, symbol, color, x, y): draw.fill_color=Color(color) draw.text(x, y, str(symbol)) draw(img) + return img +def draw_rune(img, color): + with Image(filename='assets/{}.png'.format(color)) as rune: + rune.resize(110,122) + img.composite( + rune, + left=int((img.width - rune.width) / 2), + top=int((img.height - rune.height) / 2)) return img main()