I try to put a transparent logo on the photo with Pillow:
# First, I convert my photo and watermark to RGBA:
image = Image.open(photo_image_path).convert('RGBA')
watermark = Image.open(watermark_image_path).convert('RGBA')
# then I сreate an empty layer with the same size as image
# and put watermark in x/y position
layer = Image.new('RGBA', image.size, (0, 0, 0, 0))
layer.paste(watermark, (x, y))
# then add transparency
layer.putalpha(128)
# and merge image with logo
result = Image.alpha_composite(image, layer)
Initially my watermark has a full-transparent background. But I have a result with black half-transparent background on all image size. What am I doing wrong?