nseaber commited on
Commit
8d6cd37
·
verified ·
1 Parent(s): 82a5ea6

fixing destruction of top and bottom rows of image when only expanding to the side

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -91,9 +91,9 @@ def prepare_image_and_mask(image, width, height, overlap_percentage, resize_opti
91
  overlap_x = int(new_width * (overlap_percentage / 100))
92
  overlap_y = int(new_height * (overlap_percentage / 100))
93
 
94
- # Ensure minimum overlap of 1 pixel
95
- overlap_x = max(overlap_x, 1)
96
- overlap_y = max(overlap_y, 1)
97
 
98
  # Calculate margins based on alignment
99
  if alignment == "Middle":
 
91
  overlap_x = int(new_width * (overlap_percentage / 100))
92
  overlap_y = int(new_height * (overlap_percentage / 100))
93
 
94
+ # Ensure minimum overlap of 0 pixels
95
+ overlap_x = max(overlap_x, 0)
96
+ overlap_y = max(overlap_y, 0)
97
 
98
  # Calculate margins based on alignment
99
  if alignment == "Middle":