Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Update font size and padding in bounding box drawing functions for improved visibility

Magnus Müller66822d60906c
diff --git a/browser_use/browser/python_highlights.py b/browser_use/browser/python_highlights.py
index cf958e8f4..9a91445f5 100644
--- a/browser_use/browser/python_highlights.py
+++ b/browser_use/browser/python_highlights.py
@@ -94,7 +94,7 @@ def draw_enhanced_bounding_box_with_text(
try:
# Use much bigger font size for index (5x bigger base)
huge_font = None
- font_size = 35 # Much bigger than the original 16
+ font_size = 40 # Much bigger than the original 16
try:
huge_font = ImageFont.truetype('/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf', font_size)
except (OSError, IOError):
@@ -219,7 +219,7 @@ def draw_bounding_box_with_text(
text_height = bbox_text[3] - bbox_text[1]
# Smart positioning based on element size
- padding = 3
+ padding = 5
element_width = x2 - x1
element_height = y2 - y1
element_area = element_width * element_height