class Draw: def __init__(self)
A simple 2D drawing interface for PIL images.
class ImageDraw: def __init__(self, im, mode=None)
A simple 2D drawing interface for PIL images.
Draw()
A simple 2D drawing interface for PIL images.
Note that Draw and ImageDraw are two names for the same class. New code should use Draw.
ImageDraw()
A simple 2D drawing interface for PIL images.
Note that Draw and ImageDraw are two names for the same class. New code should use Draw.
ImageDraw(im, mode=None)
Create a drawing instance.
im
-- The image to draw in.
mode
-- Optional mode to use for color values. For RGB
images, this argument can be RGB or RGBA (to blend the
drawing into the image). For all other modes, this argument
must be the same as the image mode. If omitted, the mode
defaults to the mode of the image.
arc(xy, start, end, fill=None)
Draw an arc.
arc(xy, start, end, fill=None)
Draw an arc.
bitmap(xy, bitmap, fill=None)
Draw a bitmap.
bitmap(xy, bitmap, fill=None)
Draw a bitmap.
chord(xy, start, end, fill=None, outline=None)
Draw a chord.
chord(xy, start, end, fill=None, outline=None)
Draw a chord.
ellipse(xy, fill=None, outline=None)
Draw an ellipse.
ellipse(xy, fill=None, outline=None)
Draw an ellipse.
getfont()
Get the current default font.
getfont()
Get the current default font.
line(xy, fill=None)
Draw a line, or a connected sequence of line segments.
line(xy, fill=None)
Draw a line, or a connected sequence of line segments.
pieslice(xy, start, end, fill=None, outline=None)
Draw a pieslice.
pieslice(xy, start, end, fill=None, outline=None)
Draw a pieslice.
point(xy, fill=None)
Draw one or more individual pixels.
point(xy, fill=None)
Draw one or more individual pixels.
polygon(xy, fill=None, outline=None)
Draw a polygon.
polygon(xy, fill=None, outline=None)
Draw a polygon.
rectangle(xy, fill=None, outline=None)
Draw a rectangle.
rectangle(xy, fill=None, outline=None)
Draw a rectangle.
setfill(onoff)
Set the default background color.
setfill(onoff)
Set the default background color.
setfont(font)
Set the default font.
setfont(font)
Set the default font.
setink(ink)
Set the default pen color.
setink(ink)
Set the default pen color.
shape(shape, fill=None, outline=None)
(Experimental) Draw a shape.
shape(shape, fill=None, outline=None)
(Experimental) Draw a shape.
text(xy, text, fill=None, font=None, anchor=None)
Draw text.
text(xy, text, fill=None, font=None, anchor=None)
Draw text.
textsize(text, font=None)
Get the size of a given string, in pixels.
textsize(text, font=None)
Get the size of a given string, in pixels.
arc(xy, start, end, fill=None)
Draw an arc.
arc(xy, start, end, fill=None)
Draw an arc.
bitmap(xy, bitmap, fill=None)
Draw a bitmap.
bitmap(xy, bitmap, fill=None)
Draw a bitmap.
chord(xy, start, end, fill=None, outline=None)
Draw a chord.
chord(xy, start, end, fill=None, outline=None)
Draw a chord.
ellipse(xy, fill=None, outline=None)
Draw an ellipse.
ellipse(xy, fill=None, outline=None)
Draw an ellipse.
getfont()
Get the current default font.
getfont()
Get the current default font.
line(xy, fill=None)
Draw a line, or a connected sequence of line segments.
line(xy, fill=None)
Draw a line, or a connected sequence of line segments.
pieslice(xy, start, end, fill=None, outline=None)
Draw a pieslice.
pieslice(xy, start, end, fill=None, outline=None)
Draw a pieslice.
point(xy, fill=None)
Draw one or more individual pixels.
point(xy, fill=None)
Draw one or more individual pixels.
polygon(xy, fill=None, outline=None)
Draw a polygon.
polygon(xy, fill=None, outline=None)
Draw a polygon.
rectangle(xy, fill=None, outline=None)
Draw a rectangle.
rectangle(xy, fill=None, outline=None)
Draw a rectangle.
setfill(onoff)
Set the default background color.
setfill(onoff)
Set the default background color.
setfont(font)
Set the default font.
setfont(font)
Set the default font.
setink(ink)
Set the default pen color.
setink(ink)
Set the default pen color.
shape(shape, fill=None, outline=None)
(Experimental) Draw a shape.
shape(shape, fill=None, outline=None)
(Experimental) Draw a shape.
text(xy, text, fill=None, font=None, anchor=None)
Draw text.
text(xy, text, fill=None, font=None, anchor=None)
Draw text.
textsize(text, font=None)
Get the size of a given string, in pixels.
textsize(text, font=None)
Get the size of a given string, in pixels.