Spaces:
Runtime error
Runtime error
Update texture_transfer.py
Browse files- texture_transfer.py +2 -2
texture_transfer.py
CHANGED
|
@@ -5,8 +5,8 @@ import cv2
|
|
| 5 |
|
| 6 |
|
| 7 |
def create_layover(background_image, layer_image, opacity):
|
| 8 |
-
|
| 9 |
-
background_img_raw =
|
| 10 |
background_img = np.array(background_img_raw)
|
| 11 |
background_img_float = background_img.astype(float)
|
| 12 |
foreground_img_raw = Image.open(layer_image)
|
|
|
|
| 5 |
|
| 6 |
|
| 7 |
def create_layover(background_image, layer_image, opacity):
|
| 8 |
+
background_img_raw = Image.open(background_image)
|
| 9 |
+
background_img_raw = background_img_raw.convert("RGBA")
|
| 10 |
background_img = np.array(background_img_raw)
|
| 11 |
background_img_float = background_img.astype(float)
|
| 12 |
foreground_img_raw = Image.open(layer_image)
|