Spaces:
Runtime error
Runtime error
Update overlay.py
Browse files- overlay.py +3 -3
overlay.py
CHANGED
|
@@ -38,7 +38,7 @@ def process(img,font_text,font_fac,font_x,font_y,font_col,font_op):
|
|
| 38 |
combined = Image.alpha_composite(im, txt)
|
| 39 |
return combined
|
| 40 |
|
| 41 |
-
def textover(im,
|
| 42 |
#im.save('tmp.png')
|
| 43 |
|
| 44 |
im = Image.open(im)
|
|
@@ -59,8 +59,8 @@ def textover(im,txt):
|
|
| 59 |
print (h)
|
| 60 |
font_x = (w/2)
|
| 61 |
font_y = h-hhh
|
| 62 |
-
out = process(im,
|
| 63 |
-
out = process(out,
|
| 64 |
out.save("out.png")
|
| 65 |
|
| 66 |
return "out.png"
|
|
|
|
| 38 |
combined = Image.alpha_composite(im, txt)
|
| 39 |
return combined
|
| 40 |
|
| 41 |
+
def textover(im,txt1="",txt2=""):
|
| 42 |
#im.save('tmp.png')
|
| 43 |
|
| 44 |
im = Image.open(im)
|
|
|
|
| 59 |
print (h)
|
| 60 |
font_x = (w/2)
|
| 61 |
font_y = h-hhh
|
| 62 |
+
out = process(im,txt1,font_fac=font_a,font_x=font_x,font_y=hh,font_col="#000000",font_op=255)
|
| 63 |
+
out = process(out,txt2,font_fac=font_b,font_x=font_x,font_y=font_y,font_col="#000000",font_op=255)
|
| 64 |
out.save("out.png")
|
| 65 |
|
| 66 |
return "out.png"
|