Python PIL(Pillow)有时会在透明图像上生成垃圾

时间:2013-05-20 00:16:55

标签: python python-imaging-library

当我创建一个没有颜色的图像时,我会得到垃圾(随机颜色,点或线)

image = Image.new("RGBA", (256, 256), None)

# draw a rectangle with rounded corners
image = draw_corner_box(image, radius=10)

# draw a rectangle with rounded corners and apply blur,
# paste image in the result and return
image = draw_shadow_box(image, radius=10)

image.save("image.png", "PNG")

完整图像

Image generate with PIL

缩放图像

Zoom Image generate with PIL

0 个答案:

没有答案