From b05cad5c569073d27fb8d464597bdca636a80a6d Mon Sep 17 00:00:00 2001 From: "Fredrick W. Warren" Date: Mon, 30 May 2022 10:09:54 -0700 Subject: [PATCH] write borderd text to own layer before merging down --- hcatitles.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hcatitles.py b/hcatitles.py index 1acee09..a4461c9 100644 --- a/hcatitles.py +++ b/hcatitles.py @@ -10,15 +10,17 @@ def update_image(original, title, subtitle): renders text on full sized slide make half sized copy for preview and fill top/bottom with white. """ - image = original + background = original + image = Image.new(mode="RGBA", size=(1280,720)) font1 = ImageFont.truetype('tahomabd.ttf', 50) font2 = ImageFont.truetype('tahomabd.ttf', 38) draw = ImageDraw.Draw(image) draw.text((20,520), title, font=font1, fill='white', stroke_width=4, stroke_fill='black', spacing=4) draw.text((20,588), subtitle, font=font2, fill='white', - stroke_width=3, stroke_fill='black', spacing=4) - return image + stroke_width=4, stroke_fill='black', spacing=4) + background.paste(image, (0,0), image) + return background def update_thumbnail(image): """genreate thumbnail from original image"""