From 1f38c89b3a247d95bef7a4b60208916597ba9c31 Mon Sep 17 00:00:00 2001 From: "Fredrick W. Warren" Date: Mon, 30 May 2022 10:37:48 -0700 Subject: [PATCH] use alpah compiste to merge due to tranparancy --- hcatitles.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hcatitles.py b/hcatitles.py index a4461c9..71386ae 100644 --- a/hcatitles.py +++ b/hcatitles.py @@ -10,7 +10,6 @@ def update_image(original, title, subtitle): renders text on full sized slide make half sized copy for preview and fill top/bottom with white. """ - background = original image = Image.new(mode="RGBA", size=(1280,720)) font1 = ImageFont.truetype('tahomabd.ttf', 50) font2 = ImageFont.truetype('tahomabd.ttf', 38) @@ -19,7 +18,7 @@ def update_image(original, title, subtitle): stroke_width=4, stroke_fill='black', spacing=4) draw.text((20,588), subtitle, font=font2, fill='white', stroke_width=4, stroke_fill='black', spacing=4) - background.paste(image, (0,0), image) + background = Image.alpha_composite(original, image) return background def update_thumbnail(image):