Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -220,7 +220,7 @@ def blur_im(img,bounds):
|
|
220 |
#text = "γγ€ζ©γ¦η¦"
|
221 |
text = "New Text"
|
222 |
#font = ImageFont.load_default()
|
223 |
-
|
224 |
#font = ImageFont.load("arial.pil")
|
225 |
#font = ImageFont.truetype(fontpath, 32)
|
226 |
im = Image.fromarray(im)
|
@@ -231,7 +231,13 @@ def blur_im(img,bounds):
|
|
231 |
w = int(p2[0]) - int(x)
|
232 |
h = int(p2[1]) - int(y)
|
233 |
draw = ImageDraw.Draw(im)
|
234 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
#img_tamil = np.array(img_pil)
|
236 |
return im
|
237 |
|
|
|
220 |
#text = "γγ€ζ©γ¦η¦"
|
221 |
text = "New Text"
|
222 |
#font = ImageFont.load_default()
|
223 |
+
|
224 |
#font = ImageFont.load("arial.pil")
|
225 |
#font = ImageFont.truetype(fontpath, 32)
|
226 |
im = Image.fromarray(im)
|
|
|
231 |
w = int(p2[0]) - int(x)
|
232 |
h = int(p2[1]) - int(y)
|
233 |
draw = ImageDraw.Draw(im)
|
234 |
+
|
235 |
+
font_size=round(int(w)*0.33)
|
236 |
+
font = ImageFont.truetype("./fonts/unifont-15.0.01.ttf", int(font_size))
|
237 |
+
|
238 |
+
|
239 |
+
|
240 |
+
draw.text((x+1, y+1),text, font = font, fill=(0,0,0))
|
241 |
#img_tamil = np.array(img_pil)
|
242 |
return im
|
243 |
|