Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -29,8 +29,10 @@ def imGreyAlpha(im):
|
|
29 |
alpha = px[i, j] # 获取灰度作为alpha值
|
30 |
if alpha == 0:
|
31 |
draw.point((i,j), fill=(0,0,0,0))
|
|
|
|
|
32 |
else:
|
33 |
-
draw.point((i, j), fill=(
|
34 |
|
35 |
|
36 |
return im2 # 返回图像
|
|
|
29 |
alpha = px[i, j] # 获取灰度作为alpha值
|
30 |
if alpha == 0:
|
31 |
draw.point((i,j), fill=(0,0,0,0))
|
32 |
+
# elif alpha == 255:
|
33 |
+
# draw.point((i,j), fill=(0,0,0,255))
|
34 |
else:
|
35 |
+
draw.point((i, j), fill=(255, 255, 255, 255 -alpha)) # 填充像素点
|
36 |
|
37 |
|
38 |
return im2 # 返回图像
|