johann-foerster commited on
Commit
fc2a9f2
1 Parent(s): cccb6df

new greettext+watermark design

Browse files
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

  • SHA256: 1e757aff965fa5550f635bae3ffddc84a58ec609f9c7a572789b2d3ada19b9aa
  • Pointer size: 130 Bytes
  • Size of remote file: 11.4 kB

Git LFS Details

  • SHA256: f8f559946b0b52bbd853233f60e271a9687f7ec5d1bed82248f43476d99f9240
  • Pointer size: 129 Bytes
  • Size of remote file: 3.52 kB
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
- image.rectangle(((0 if toggle_greet else 1280-HEIGHT-2*TEXT_PADDING, 768-HEIGHT), (1280, 768)), fill=(255, 255, 255, 222))
 
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/SourceSansPro-Regular.ttf', floor(1.5*TEXTBOX_HEIGHT)), fill=(100, 180, 69))
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