1 year ago
#328398
Naomi
PIL Blurry at Low Resolutions
I'm building a 2D pixel art game for personal use, and I'm keen not to create 200 odd NPCs, so I wrote a python script to take a .png component (head, hair, body, accessories) and add them together. These files are only 64, 128 in size, so are very small.
No matter what I use, I always end up with a strange grey blur around the faces and some of the colours are slightly shifted (even if they were originally taken from the same picture). (see picture below)
I've tried newimg.paste(img, (0,0), img), and I've even tried a loop where I've taken each pixel and (if it isn't (0,0,0,0),) replace the old pixel. I still end up with this bizarre zombie effect! It's not in any of the individual images from what I can see.
I was expecting to see the images overlaid one on top of the other. Instead I'm seeing this bizarre pixelated blur of all the images.
Is this something to do with how I've loaded it in? (Image.open(filepath)). Is it something to do with the img.save and img.show functions?
Looking for any experience someone might have.
python
image
python-imaging-library
blurry
0 Answers
Your Answer