I want to paste one photo over another, adding a round transparency frame over the first one. I come from the following question: Previous question
tap = Image.open ("./background.png")
userImg = Image.open("./inphoto.png")
#tap variable is image correctly loaded, the background
draw = ImageDraw.Draw(tap)
#rounded mask
backg = Image.new(userImg.mode, size, (0,0,0))
mask = Image.new("L", size, color=0)
imgD = ImageDraw.Draw(mask)
blur_radius = 2
offset = 4
offset = blur_radius * 2 + offset
imgD.ellipse((offset, offset, 125 - offset, 125 - offset), fill=255)
mask = mask.filter(ImageFilter.GaussianBlur(blur_radius)
finalImgRound = Image.composite(userImg, backg, mask=mask)
#tap variable is the background
tap.paste(finalImgRound, (50, 50))
As you can see in the example image, the black frame continues in the image frame, and does not produce any transparency effect (the original image is square, and the code above adds the black frame, but not transparency).
Paste with background result --->
(I add green backgraound below):
How can I apply the transparency in the black area?
Edited: As suggested by member's of SO. Added original picture. Remove unuseful code.