







The PIL.ImageDraw Module


Draw(im, mode=None)  [ #PIL.ImageDraw.Draw-function# ]

A simple 2D drawing interface for PIL images.


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.



ImageDraw(im, mode=None) (class) [ #PIL.ImageDraw.ImageDraw-class# ]

A simple 2D drawing interface for PIL images.

For more information about this class, see #PIL.ImageDraw.ImageDraw-classThe ImageDraw Class .



The ImageDraw Class 


ImageDraw(im, mode=None) (class) [ #PIL.ImageDraw.ImageDraw-class# ]

A simple 2D drawing interface for PIL images.

Application code should use the 
Draw factory, instead of
directly.

__init__(im, mode=None)  [ #PIL.ImageDraw.ImageDraw.__init__-method# ]

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)  [ #PIL.ImageDraw.ImageDraw.arc-method# ]

Draw an arc.


bitmap(xy, bitmap, fill=None)  [ #PIL.ImageDraw.ImageDraw.bitmap-method# ]

Draw a bitmap.


chord(xy, start, end, fill=None, outline=None)  [ #PIL.ImageDraw.ImageDraw.chord-method# ]

Draw a chord.


ellipse(xy, fill=None, outline=None)  [ #PIL.ImageDraw.ImageDraw.ellipse-method# ]

Draw an ellipse.


getfont()  [ #PIL.ImageDraw.ImageDraw.getfont-method# ]

Get the current default font.


line(xy, fill=None, width=0)  [ #PIL.ImageDraw.ImageDraw.line-method# ]

Draw a line, or a connected sequence of line segments.


pieslice(xy, start, end, fill=None, outline=None)  [ #PIL.ImageDraw.ImageDraw.pieslice-method# ]

Draw a pieslice.


point(xy, fill=None)  [ #PIL.ImageDraw.ImageDraw.point-method# ]

Draw one or more individual pixels.


polygon(xy, fill=None, outline=None)  [ #PIL.ImageDraw.ImageDraw.polygon-method# ]

Draw a polygon.


rectangle(xy, fill=None, outline=None)  [ #PIL.ImageDraw.ImageDraw.rectangle-method# ]

Draw a rectangle.


setfill(onoff)  [ #PIL.ImageDraw.ImageDraw.setfill-method# ]

Set the default background color.


setfont(font)  [ #PIL.ImageDraw.ImageDraw.setfont-method# ]

Set the default font.


setink(ink)  [ #PIL.ImageDraw.ImageDraw.setink-method# ]

Set the default pen color.


shape(shape, fill=None, outline=None)  [ #PIL.ImageDraw.ImageDraw.shape-method# ]

(Experimental) Draw a shape.


text(xy, text, fill=None, font=None, anchor=None)  [ #PIL.ImageDraw.ImageDraw.text-method# ]

Draw text.


textsize(text, font=None)  [ #PIL.ImageDraw.ImageDraw.textsize-method# ]

Get the size of a given string, in pixels.




