mcrlc commited on
Commit
2e319dc
1 Parent(s): eb5f90c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -138,11 +138,8 @@ def inference(image: Image):
138
  bg_color = 0x00C49AFF
139
  w = im_rgba.size[0]
140
  h = im_rgba.size[1]
141
-
142
- bg = Image.new("RGBA", (w,h), bg_color)
143
- im_colored = Image.new("RGBA", (w,h))
144
- im_colored.paste(bg)
145
- im_colored.paste(im_rgba)
146
 
147
  return [im_colored, pil_mask]
148
 
 
138
  bg_color = 0x00C49AFF
139
  w = im_rgba.size[0]
140
  h = im_rgba.size[1]
141
+ im_colored = Image.new("RGBA", (w,h), bg_color)
142
+ im_colored.alpha_composite(im_rgba)
 
 
 
143
 
144
  return [im_colored, pil_mask]
145