Functionize save img for post processing later
This commit is contained in:
parent
8a16f37328
commit
87d80ddca3
1 changed files with 4 additions and 1 deletions
5
main.py
5
main.py
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue