docstr: Create a drawing instance.
  
  :param im: The image to draw in.
  :param 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.
docstr_tok: ["Create","a","drawing","instance",".",":","param","im",":","The","image","to","draw","in",".",":","param","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","."]
code: def __init__(self, im, mode=None):
      """
      Create a drawing instance.
  
      :param im: The image to draw in.
      :param 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.
      """
      im.load()
      if im.readonly:
          im._copy()  # make it writeable
      blend = 0
      if mode is None:
          mode = im.mode
      if mode != im.mode:
          if mode == "RGBA" and im.mode == "RGB":
              blend = 1
          else:
              raise ValueError("mode mismatch")
      if mode == "P":
          self.palette = im.palette
      else:
          self.palette = None
      self._image = im
      self.im = im.im
      self.draw = Image.core.draw(self.im, blend)
      self.mode = mode
      if mode in ("I", "F"):
          self.ink = self.draw.draw_ink(1)
      else:
          self.ink = self.draw.draw_ink(-1)
      if mode in ("1", "P", "I", "F"):
          # FIXME: fix Fill2 to properly support matte for I+F images
          self.fontmode = "1"
      else:
          self.fontmode = "L"  # aliasing is okay for other modes
      self.fill = 0
      self.font = None
  
imports: import math
  import numbers
  from .None import Image, ImageColor, ImageFont
label_desc: Use image node_id 1 to create a new ImageDraw object  with example: obj = ImageDraw(im, mode)