moviepy.video.tools.drawing.circle#

moviepy.video.tools.drawing.circle(screensize, center, radius, color=1.0, bg_color=0, blur=1)[source]#

Draw an image with a circle.

Draws a circle of color color, on a background of color bg_color, on a screen of size screensize at the position center=(x, y), with a radius radius but slightly blurred on the border by blur pixels.

Parameters:
  • screensize (tuple or list) -- Size of the canvas.

  • center (tuple or list) -- Center of the circle.

  • radius (float) -- Radius of the circle, in pixels.

  • bg_color (tuple or float, optional) -- Color for the background of the canvas. As default, black.

  • blur (float, optional) -- Blur for the border of the circle.

Examples

from moviepy.video.tools.drawing import circle

circle(
    (5, 5),  # size
    (2, 2),  # center
    2,      # radius
)
# array([[0.        , 0.        , 0.        , 0.        , 0.        ],
#        [0.        , 0.58578644, 1.        , 0.58578644, 0.        ],
#        [0.        , 1.        , 1.        , 1.        , 0.        ],
#        [0.        , 0.58578644, 1.        , 0.58578644, 0.        ],
#        [0.        , 0.        , 0.        , 0.        , 0.        ]])