I was trying to resize an image to a circular shape, but if i run the code, the transparency of the image is gone.
from PIL import Image,ImageOps
pb = Image.open('pb_image')
bigsize = (pb.size[0] * 3, pb.size[1] * 3)
mask = Image.new('L', bigsize, 0)
mask = mask.resize(pb.size, Image.ANTIALIAS)
pb.putalpha(mask)
circled = ImageOps.fit(pb, mask.size, centering=(0.5, 0.5))
circled.putalpha(mask)
circled.show()
This is my code (pb is a loaded image), but either the image is not resized at all, the image is resized but the transparent places are black or the image is completely transparent. I dont know how to fix this im new to pillow. Thanks in advance.