Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -164,9 +164,9 @@ def prepare_image_and_mask(image, width, height, overlap_percentage, resize_opti
|
|
164 |
margin_y = max(0, min(margin_y + y_offset, target_size[1] - new_height))
|
165 |
|
166 |
if image.mode == "RGBA":
|
167 |
-
background = Image.new("RGBA", target_size, (255, 255, 255, 255)
|
168 |
else:
|
169 |
-
background = Image.new("RGB", target_size, (255, 255, 255)
|
170 |
|
171 |
background.paste(source, (margin_x, margin_y))
|
172 |
|
|
|
164 |
margin_y = max(0, min(margin_y + y_offset, target_size[1] - new_height))
|
165 |
|
166 |
if image.mode == "RGBA":
|
167 |
+
background = Image.new("RGBA", target_size, (255, 255, 255, 255))
|
168 |
else:
|
169 |
+
background = Image.new("RGB", target_size, (255, 255, 255))
|
170 |
|
171 |
background.paste(source, (margin_x, margin_y))
|
172 |
|