Omnibus commited on
Commit
48ac023
Β·
1 Parent(s): 2e78487

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -220,7 +220,7 @@ def blur_im(img,bounds):
220
  #text = "ポむ橋て禁"
221
  text = "New Text"
222
  #font = ImageFont.load_default()
223
- font = ImageFont.truetype("./fonts/unifont-15.0.01.ttf", 40)
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
- draw.text((x+5, y+5),text, font = font, fill=(0,0,0))
 
 
 
 
 
 
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