Spaces:
Running
on
Zero
Running
on
Zero
fixing destruction of top and bottom rows of image when only expanding to the side
Browse files
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
|
95 |
-
overlap_x = max(overlap_x,
|
96 |
-
overlap_y = max(overlap_y,
|
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":
|