I'm trying to add alpha channel on an image, but the result is not the expected one:
from PIL import Image
baseImage = Image.open('baseimage.png').convert('RGBA')
alphaImage = Image.open('alphaimage.png').convert('L')
baseImage.putalpha(alphaImage)
baseImage.save('newimage.tiff', 'TIFF', compression='tiff_adobe_deflate')
Here's the given result:
The expected result:
Is it possible to prevent premultiplication ? I also tried to split bands and merge them with the new alpha channel, but it was the same result.
You could try to reverse premultiplication manually like this: