python - Python3 PIL (Pillow) draw.pieslice bad arc -
i'm dawing simple pieslice pil
image = image.new("rgba", (256, 128), "#ddd") draw = imagedraw.draw(image, image.mode) draw.pieslice((0, 0 , 64, 64), 180, 270, fill="white) del draw image.save("file.png", "png")
as can see arc not perfect. how can make perfect arc pil?
draw on larger image, downscale:
n=4 image = image.new("rgba", (256*n, 128*n), "#ddd") draw = imagedraw.draw(image, image.mode) draw.pieslice((0, 0 , 64*n, 64*n), 180, 270, fill="white") del draw image = image.resize((256,128)) # using user3479125's correction image.save("file2.png", "png")
Comments
Post a Comment