AMfeta99 commited on
Commit
7c39f6b
·
verified ·
1 Parent(s): 8b801a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -20,7 +20,7 @@ def add_label_to_image(image, label):
20
  # Calculate the size and position of the text (aligned to the left)
21
  text_bbox = draw.textbbox((0, 0), label, font=font)
22
  text_width, text_height = text_bbox[2] - text_bbox[0], text_bbox[3] - text_bbox[1]
23
- position = (image.height - text_height - 20, 20) # right-aligned with margin
24
 
25
  # Add a semi-transparent rectangle behind the text for better visibility
26
  rect_margin = 10
 
20
  # Calculate the size and position of the text (aligned to the left)
21
  text_bbox = draw.textbbox((0, 0), label, font=font)
22
  text_width, text_height = text_bbox[2] - text_bbox[0], text_bbox[3] - text_bbox[1]
23
+ position = (image.width - text_width - 20, image.height - text_height - 20)# right-aligned with margin
24
 
25
  # Add a semi-transparent rectangle behind the text for better visibility
26
  rect_margin = 10