I’m using ImageOps to resize and center-crop uploaded avatar images. The problem is, when I try to upload an image that is already the desired size, the uploaded image is blurred.
The relevant code:
avatar_size = (59,59)
#resized_im = im.resize(avatar_size, Image.ANTIALIAS) #This works! But doesn't crop.
formatted_im = ImageOps.fit(im, avatar_size, Image.ANTIALIAS, centering=(0.5,0.5))
formatted_im.save('foo.jpg', 'JPEG', quality=95)
So, when I upload a 59x59px image, the resulting upload on the server is blurred. Tried googling, reading the docs, and experimenting, but can’t figure this out. Thanks for the help.
It is probably the antialiasing which is causing the blur.
How about try: