johann-foerster
commited on
Commit
•
fc2a9f2
1
Parent(s):
cccb6df
new greettext+watermark design
Browse files- resources/Neuton-ExtralightItalic.ttf +0 -0
- resources/SourceSansPro-Regular.ttf +0 -0
- resources/qm_logo.png +2 -2
- webui.py +4 -2
resources/Neuton-ExtralightItalic.ttf
ADDED
Binary file (40.5 kB). View file
|
|
resources/SourceSansPro-Regular.ttf
DELETED
Binary file (119 kB)
|
|
resources/qm_logo.png
CHANGED
Git LFS Details
|
Git LFS Details
|
webui.py
CHANGED
@@ -72,11 +72,13 @@ def overlay_image(image_path, toggle_greet, greet):
|
|
72 |
HEIGHT, TEXT_PADDING, TEXTBOX_HEIGHT = 100, 32, 56
|
73 |
TEXTBOX_WIDTH = 1280-HEIGHT-4*TEXT_PADDING
|
74 |
|
75 |
-
|
|
|
76 |
image._image.paste(QM_LOGO, (1135,675), QM_LOGO)
|
77 |
if (toggle_greet):
|
|
|
78 |
txt_image = Image.new('RGBA', (4*1280, 4*TEXTBOX_HEIGHT), (255,255,255,0))
|
79 |
-
ImageDraw.Draw(txt_image).text(xy=(0,0), text=greet, font=ImageFont.truetype('resources/
|
80 |
image_box = txt_image.getbbox()
|
81 |
txt_image = txt_image.crop(image_box)
|
82 |
width, height = txt_image.size
|
|
|
72 |
HEIGHT, TEXT_PADDING, TEXTBOX_HEIGHT = 100, 32, 56
|
73 |
TEXTBOX_WIDTH = 1280-HEIGHT-4*TEXT_PADDING
|
74 |
|
75 |
+
X_RECT=1280-HEIGHT-2*TEXT_PADDING
|
76 |
+
image.rectangle(((X_RECT, 768-HEIGHT), (1280, 768)), fill=(0, 0, 0, 50))
|
77 |
image._image.paste(QM_LOGO, (1135,675), QM_LOGO)
|
78 |
if (toggle_greet):
|
79 |
+
image.rectangle(((0, 768-HEIGHT), (X_RECT-1, 768)), fill=(255, 255, 255, 166))
|
80 |
txt_image = Image.new('RGBA', (4*1280, 4*TEXTBOX_HEIGHT), (255,255,255,0))
|
81 |
+
ImageDraw.Draw(txt_image).text(xy=(0,0), text=greet, font=ImageFont.truetype('resources/Neuton-ExtralightItalic.ttf', floor(1.5*TEXTBOX_HEIGHT)), fill=(0, 0, 0))
|
82 |
image_box = txt_image.getbbox()
|
83 |
txt_image = txt_image.crop(image_box)
|
84 |
width, height = txt_image.size
|