#๐Ÿ”’ Image Position

6 messages ยท Page 1 of 1 (latest)

solemn eagleBOT
#

@celest summit

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

celest summit
#
base_image = Image.open('base_image.png')
    img_data = requests.get(member.avatar.url).content
    overlay_image = Image.open(io.BytesIO(img_data))

    base_image = base_image.resize((2479, 1080))
    overlay_image = overlay_image.resize((500, 500))

    if overlay_image.mode != 'RGBA':
        overlay_image = overlay_image.convert('RGBA')

    position = (1239, 540)

    new_image = Image.new('RGBA', base_image.size)
    new_image.paste(base_image, (0, 0))
    new_image.paste(overlay_image, position, overlay_image)

    result_image_path = 'result_image.png'
    new_image.save(result_image_path)

    channel = bot.get_channel(CHANNEL_ID)
    if channel:
        with open(result_image_path, 'rb') as f:
            picture = discord.File(f, filename='result_image.png')
            await channel.send(f"Greetings and welcome to core, {member.mention}", file=picture)
    else:
        print("Channel not found!")```
neon shore
#

?? question ??

celest summit
solemn eagleBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.