Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -29,7 +29,8 @@ def resize_and_pad(image, target_size):
|
|
29 |
new_height = target_size[1]
|
30 |
new_width = int(new_height * aspect_ratio)
|
31 |
|
32 |
-
|
|
|
33 |
|
34 |
# Determine padding color
|
35 |
dominant_color = get_dominant_color(img)
|
@@ -65,7 +66,7 @@ def combine_images(images, target_size=(2048, 2048)):
|
|
65 |
|
66 |
# Resize if the final size exceeds target
|
67 |
if combined_img.width > target_size[0] or combined_img.height > target_size[1]:
|
68 |
-
combined_img = combined_img.resize(target_size, Image.
|
69 |
|
70 |
output_images.append(combined_img)
|
71 |
|
|
|
29 |
new_height = target_size[1]
|
30 |
new_width = int(new_height * aspect_ratio)
|
31 |
|
32 |
+
# Use Image.Resampling.LANCZOS instead of Image.ANTIALIAS
|
33 |
+
img = img.resize((new_width, new_height), Image.Resampling.LANCZOS)
|
34 |
|
35 |
# Determine padding color
|
36 |
dominant_color = get_dominant_color(img)
|
|
|
66 |
|
67 |
# Resize if the final size exceeds target
|
68 |
if combined_img.width > target_size[0] or combined_img.height > target_size[1]:
|
69 |
+
combined_img = combined_img.resize(target_size, Image.Resampling.LANCZOS)
|
70 |
|
71 |
output_images.append(combined_img)
|
72 |
|