fffiloni commited on
Commit
0aa4565
1 Parent(s): c6d3715

patch tiny white gaps

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -125,10 +125,11 @@ def prepare_image_and_mask(image, width, height, overlap_percentage, resize_opti
125
  mask_draw = ImageDraw.Draw(mask)
126
 
127
  # Calculate overlap areas
128
- left_overlap = margin_x + overlap_x if overlap_left else margin_x
129
- right_overlap = margin_x + new_width - overlap_x if overlap_right else margin_x + new_width
130
- top_overlap = margin_y + overlap_y if overlap_top else margin_y
131
- bottom_overlap = margin_y + new_height - overlap_y if overlap_bottom else margin_y + new_height
 
132
 
133
  # Draw the mask
134
  mask_draw.rectangle([
 
125
  mask_draw = ImageDraw.Draw(mask)
126
 
127
  # Calculate overlap areas
128
+ white_gaps_patch = 2
129
+ left_overlap = margin_x + overlap_x if overlap_left else margin_x + white_gaps_patch
130
+ right_overlap = margin_x + new_width - overlap_x if overlap_right else margin_x + new_width + white_gaps_patch
131
+ top_overlap = margin_y + overlap_y if overlap_top else margin_y + white_gaps_patch
132
+ bottom_overlap = margin_y + new_height - overlap_y if overlap_bottom else margin_y + new_height + white_gaps_patch
133
 
134
  # Draw the mask
135
  mask_draw.rectangle([