[Image-SIG] Bug in rotate with expand=True
Ole Laursen
olau at iola.dk
Fri Apr 4 11:31:03 CEST 2008
Hi,
Try this
import Image, ImageDraw
i = Image.new("RGBA", (100, 100), (255, 0, 0, 0))
draw = ImageDraw.Draw(i)
draw.line([(0, 50), (100, 50)], fill=(255, 0, 0), width=3)
i.save("original.png")
i.rotate(15, Image.BICUBIC, True).save("enlarged.png")
i.rotate(15, Image.BICUBIC, False).save("not-enlarged.png")
Then take a look at "enlarged.png". Contrary to "not-enlarged.png",
it's not anti-aliased in spite of both having Image.BICUBIC set. I
believe this is a bug in rotate(). It appears to be a question of line
1320 in Image.py
return self.transform((w, h), AFFINE, matrix)
missing the resample parameter
return self.transform((w, h), AFFINE, matrix, resample)
(Please keep the CC as I'm not subscribed to the list.)
--
Ole Laursen
http://www.iola.dk/
More information about the Image-SIG
mailing list