Module PIL.ImageDraw
Module Summary:
#37
class Draw
:
def __init__(self)
A simple 2D drawing interface for PIL images.
#37
class ImageDraw
:
def __init__(self, im, mode=None)
A simple 2D drawing interface for PIL images.
Classes
The Draw Class
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
.
The ImageDraw Class
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
.
Constructor:
ImageDraw(im, mode=None)
Create a drawing instance.
Parameters:
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.
Method Summary:
#142
arc(xy, start, end, fill=None)
Draw an arc.
#142
arc(xy, start, end, fill=None)
Draw an arc.
#150
bitmap(xy, bitmap, fill=None)
Draw a bitmap.
#150
bitmap(xy, bitmap, fill=None)
Draw a bitmap.
#161
chord(xy, start, end, fill=None, outline=None)
Draw a chord.
#161
chord(xy, start, end, fill=None, outline=None)
Draw a chord.
#171
ellipse(xy, fill=None, outline=None)
Draw an ellipse.
#171
ellipse(xy, fill=None, outline=None)
Draw an ellipse.
#103
getfont()
Get the current default font.
#103
getfont()
Get the current default font.
#181
line(xy, fill=None)
Draw a line, or a connected sequence of line segments.
#181
line(xy, fill=None)
Draw a line, or a connected sequence of line segments.
#201
pieslice(xy, start, end, fill=None, outline=None)
Draw a pieslice.
#201
pieslice(xy, start, end, fill=None, outline=None)
Draw a pieslice.
#211
point(xy, fill=None)
Draw one or more individual pixels.
#211
point(xy, fill=None)
Draw one or more individual pixels.
#219
polygon(xy, fill=None, outline=None)
Draw a polygon.
#219
polygon(xy, fill=None, outline=None)
Draw a polygon.
#229
rectangle(xy, fill=None, outline=None)
Draw a rectangle.
#229
rectangle(xy, fill=None, outline=None)
Draw a rectangle.
#89
setfill(onoff)
Set the default background color.
#89
setfill(onoff)
Set the default background color.
#96
setfont(font)
Set the default font.
#96
setfont(font)
Set the default font.
#78
setink(ink)
Set the default pen color.
#78
setink(ink)
Set the default pen color.
#189
shape(shape, fill=None, outline=None)
(Experimental) Draw a shape.
#189
shape(shape, fill=None, outline=None)
(Experimental) Draw a shape.
#239
text(xy, text, fill=None, font=None, anchor=None)
Draw text.
#239
text(xy, text, fill=None, font=None, anchor=None)
Draw text.
#113
textsize(text, font=None)
Get the size of a given string, in pixels.
#113
textsize(text, font=None)
Get the size of a given string, in pixels.
arc
arc(xy, start, end, fill=None)
Draw an arc.
arc
arc(xy, start, end, fill=None)
Draw an arc.
bitmap
bitmap(xy, bitmap, fill=None)
Draw a bitmap.
bitmap
bitmap(xy, bitmap, fill=None)
Draw a bitmap.
chord
chord(xy, start, end, fill=None, outline=None)
Draw a chord.
chord
chord(xy, start, end, fill=None, outline=None)
Draw a chord.
ellipse
ellipse(xy, fill=None, outline=None)
Draw an ellipse.
ellipse
ellipse(xy, fill=None, outline=None)
Draw an ellipse.
getfont
getfont()
Get the current default font.
getfont
getfont()
Get the current default font.
line
line(xy, fill=None)
Draw a line, or a connected sequence of line segments.
line
line(xy, fill=None)
Draw a line, or a connected sequence of line segments.
pieslice
pieslice(xy, start, end, fill=None, outline=None)
Draw a pieslice.
pieslice
pieslice(xy, start, end, fill=None, outline=None)
Draw a pieslice.
point
point(xy, fill=None)
Draw one or more individual pixels.
point
point(xy, fill=None)
Draw one or more individual pixels.
polygon
polygon(xy, fill=None, outline=None)
Draw a polygon.
polygon
polygon(xy, fill=None, outline=None)
Draw a polygon.
rectangle
rectangle(xy, fill=None, outline=None)
Draw a rectangle.
rectangle
rectangle(xy, fill=None, outline=None)
Draw a rectangle.
setfill
setfill(onoff)
Set the default background color.
setfill
setfill(onoff)
Set the default background color.
setfont
setfont(font)
Set the default font.
setfont
setfont(font)
Set the default font.
setink
setink(ink)
Set the default pen color.
setink
setink(ink)
Set the default pen color.
shape
shape(shape, fill=None, outline=None)
(Experimental) Draw a shape.
shape
shape(shape, fill=None, outline=None)
(Experimental) Draw a shape.
text
text(xy, text, fill=None, font=None, anchor=None)
Draw text.
text
text(xy, text, fill=None, font=None, anchor=None)
Draw text.
textsize
textsize(text, font=None)
Get the size of a given string, in pixels.
textsize
textsize(text, font=None)
Get the size of a given string, in pixels.
