Python PIL glitches when I resize with 'Image.ANTIALIAS' -


if resize image in python using

img=img.resize((w,h), image.antialias) 

it gives me left half of image. works fine without antialiasing, ugly. has seen this? here minimal working(?) example works/fails tif i've tried:

import image import numpy np import matplotlib.pyplot plt  img=image.open("test.tif") img=img.resize((300,300), image.antialias) imgm=np.asarray(img.getdata()).reshape(img.size[1],img.size[0]) imgm=np.log10(imgm)  imgview=plt.imshow(imgm) 

edit: repeating this, right side of image different each time, though contains glitched portion of left side of original image.

this seems work ok me pillow using marbles.tif:

from pil import image  img=image.open("marbles.tif") img=img.resize((300,300), image.antialias)  img.show() 

adding:

img.save("test.png") 

i get:

test.png


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -