python - How to rotate ellipse in PIL(Pillow) -
so want add rotated ellipse (with transparency) onto image. how can this? so:
def create_ellipse(fi): ellipse = image.new('rgba', (4*b, b*2), (255,255,255,0)) draw_ellipse = imagedraw.draw(ellipse, "rgba") draw = imagedraw.draw(im, 'rgba') l in range(b, -1, -1): colour = (red, green, blue, int(alpha/(b))) draw_ellipse.ellipse((b*2-l*2, b-l, b*2+l*2, b+l), fill=colour) rotated = ellipse.rotate(fi, expand=1, resample=image.bicubic) im.paste(rotated, (x0-2*b, y0-b), rotated) return im
but main picture has gray background have problems opacity.
Comments
Post a Comment