From 545f1c2a365a6b64481ca5061274bd05d58cea62 Mon Sep 17 00:00:00 2001 From: spengreb Date: Fri, 28 May 2021 15:23:09 +0200 Subject: [PATCH] Negative colors on wizard. Fixed saving for nothing cards and wiz cards --- main.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 38f1e81..21d3c00 100755 --- a/main.py +++ b/main.py @@ -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']