Negative colors on wizard. Fixed saving for nothing cards and wiz cards

This commit is contained in:
spengreb 2021-05-28 15:23:09 +02:00
parent 1a372dc3b5
commit 545f1c2a36

11
main.py
View file

@ -39,9 +39,15 @@ def draw_card_face(color, symbol):
draw_symbol(img, symbol, color.hex_val, 120, 190)
draw_symbol(img, symbol, color.hex_val, int(img.width - 120), 190)
draw_rune(img, color)
draw_card_trim(img)
draw_mask(img)
if (symbol == "W"):
img.negate(channel="rgb")
draw_card_trim(img)
save_img(img, color.asset, symbol)
if (symbol == "W"):
save_img(img, color.asset, 40)
if (symbol == "N"):
save_img(img, color.asset, 0)
def draw_symbol(img, symbol, hex_color, x, y):
with Drawing() as draw:
@ -89,7 +95,8 @@ def draw_mask(img):
img.composite_channel('all_channels', mask, 'screen')
img.opaque_paint(target=Color("#c300ff"), fill=Color("transparent"), fuzz=0.4*img.quantum_range)
return img
def save_img(img, color, symbol):
print('Created card {} {}'.format(color, symbol))
sizes = ['50', '25']