Python PIL: How to draw an ellipse in the middle of an image?

后端 未结 2 1712
后悔当初
后悔当初 2020-12-14 23:34

I seem to be having some trouble getting this code to work:

import Image, ImageDraw

im = Image.open(\"1.jpg\")

draw = ImageDraw.Draw(im)
draw.ellipse((60,          


        
2条回答
  •  无人及你
    2020-12-14 23:38

    The ellipse function draws an ellipse within a bounding box. So you need to use draw.ellipse((40,40,60,60)) or other coordinates where the top left is smaller than the bottom right.

提交回复
热议问题