diff --git a/hcatitles.py b/hcatitles.py index 5622d84..e41599b 100644 --- a/hcatitles.py +++ b/hcatitles.py @@ -11,10 +11,10 @@ def update_image(original, title, subtitle): make half sized copy for preview and fill top/bottom with white. """ # render text - image = Image.new(mode="RGBA", size=(1280,720)) + text = Image.new(mode="RGBA", size=(1280,720)) font1 = ImageFont.truetype('tahomabd.ttf', 50) font2 = ImageFont.truetype('tahomabd.ttf', 38) - draw = ImageDraw.Draw(image) + draw = ImageDraw.Draw(text) 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', @@ -39,8 +39,9 @@ def update_image(original, title, subtitle): alpha = ImageEnhance.Brightness(alpha).enhance(.9) dropshadow.putalpha(alpha) + # merge dropshdow then text layer onto background background = Image.alpha_composite(original, dropshadow) - background = Image.alpha_composite(background, image) + background = Image.alpha_composite(background, text) return background def update_thumbnail(image):