altayavci commited on
Commit
18bc874
1 Parent(s): 13e4b2b

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +2 -3
utils.py CHANGED
@@ -1,9 +1,8 @@
1
  from PIL import Image
2
 
3
 
4
- def alpha_composite(img: Image, background: Image = None):
5
- if not background:
6
- background = Image.new("RGBA", img.size, (255, 255, 255))
7
  result = Image.alpha_composite(background, img.convert("RGBA"))
8
  result = result.convert("RGB")
9
  return result
 
1
  from PIL import Image
2
 
3
 
4
+ def alpha_composite_manuel(img: Image):
5
+ background = Image.new("RGBA", img.size, (255, 255, 255))
 
6
  result = Image.alpha_composite(background, img.convert("RGBA"))
7
  result = result.convert("RGB")
8
  return result