#๐Ÿ”’ pixelated images using PIL

18 messages ยท Page 1 of 1 (latest)

left scarab
#

trying to use PIL to put images on top of another but it ends up pixelated

short wharfBOT
#

@left scarab

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.

left scarab
#

here's what it looks like

#

if any code is needed, let me know

#

but you can see the avatar has a pixelated outline

#

i tried to make it look better by blurring it but it doesn't help

#

also the text is quite low res

tacit stream
#

my guess would be that you first cropped the avatar to a circle (while low-res), and then scaled it up

left scarab
#

this is what i'm trying to emulate:

left scarab
#

so i should fetch the image as like 512x512?

tacit stream
#

that's a good idea too, though it's not what I said

#

even if the avatar you have is very low-res, you should be able to crop it to a perfect circle as long as you first scale it up to the size it'll be in the final image, and then crop it. whereas your circle has giant pixels, suggesting you did it in the opposite order.

left scarab
#

when i cropped it, it was the same size

#

i place it on the mask in the exact location with the exact size it's going to be on the final image in

short wharfBOT
#
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.