This commit is contained in:
2024-09-10 14:44:04 +08:00
parent b60dda21ea
commit 6e7c39ed51
2 changed files with 1 additions and 1 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 KiB

After

Width:  |  Height:  |  Size: 219 KiB

+1 -1
View File
@@ -7,7 +7,7 @@ img_rgba=cv.cvtColor(img,cv.COLOR_BGR2BGRA)
# split alpha channel
blue,green,red,alpha = cv.split(img_rgba)
#set alpha channel
alpha[int(alpha.shape[0]/2):alpha.shape[0],int(alpha.shape[1]/2):alpha.shape[1]]=0
alpha[int(alpha.shape[0]/2):alpha.shape[0],int(alpha.shape[1]/2):alpha.shape[1]]=128
# remix alpha to img_rgba
img_rgba=cv.merge((blue,green,red,alpha))
# show