looking for some solutions? You are welcome.

SOLVED: Image does not change when adding an alpha channel

jdhao:

The pillow package has a method called Image.putalpha() which is used to add or change the alpha channel of an image.

I tried to play with this method and found that I can not change the background color of an image. The original image is

enter image description here

This is my code to add alpha to it

from PIL import Image

im_owl = Image.open("owl.jpg")

alpha = Image.new("L", im_owl.size, 50)
im_owl.putalpha(alpha)

im_owl.show()

The produced image is nothing different from the original image. I have tried with different value of alpha and see no difference.

What could have been wrong?



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
Share:

No comments:

Recent