Answer the question
In order to leave comments, you need to log in
How to remove the black background on the profile picture in the pillow library?
Here is my code for getting the user's avatar. But if the user has a transparent background on the avatar, then it will turn black. How to fix it so that there is no black background?
member = ctx.author
banner = Image.open("./core/image/Fon.jpg")
asset = member.avatar_url_as(size = 128)
data = io.BytesIO(await asset.read())
pfp = Image.open(data)
pfp = pfp.resize((200,200))
banner.paste(pfp, (20,20))
banner.save("profile.png")
await ctx.send(file = discord.File("profile.png"))
Answer the question
In order to leave comments, you need to log in
We need to add an alpha channel.
For example: Create transparent png image with Python, Pillow (...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question