Functionize save img for post processing later

This commit is contained in:
Spengreb 2021-01-14 22:29:56 +01:00
parent 8a16f37328
commit 87d80ddca3

View file

@ -25,7 +25,7 @@ def draw_card_face(color, symbol):
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))
save_img(img, color, symbol)
def draw_symbol(img, symbol, color, x, y):
with Drawing() as draw:
@ -46,4 +46,7 @@ def draw_rune(img, color):
top=int((img.height - rune.height) / 2))
return img
def save_img(img, color, symbol):
img.save(filename='output/card-{}-{}.png'.format(color, symbol))
main()