make dropshadow 10% transparent

This commit is contained in:
Fredrick W. Warren 2022-05-30 11:07:50 -07:00
parent 6363327c5e
commit 94a610c1a6

View File

@ -1,5 +1,5 @@
import PySimpleGUI as sg
from PIL import Image, ImageDraw, ImageFilter, ImageFont, ImageOps
from PIL import Image, ImageDraw, ImageEnhance, ImageFilter, ImageFont, ImageOps
from io import BytesIO
# Globals
@ -34,6 +34,10 @@ def update_image(original, title, subtitle):
for i in range(6):
dropshadow = dropshadow.filter(ImageFilter.BLUR)
# make dropdhadow 10% transparent
alpha = dropshadow.split()[3]
alpha = ImageEnhance.Brightness(alpha).enhance(.9)
dropshadow.putalpha(alpha)
background = Image.alpha_composite(original, dropshadow)
background = Image.alpha_composite(background, image)