title: PIL ImageDraw.Draw() doesn't work when used in a function
body: <p>I made a program that renders the Mandelbrot set to an image. I put the draw.point() method in a function, but it doesn't seem to actually draw on the final image, but if I put im.save() in the function it does work. The full code actually uses multiprocessing and renders the image CineBench style, which is why I can't put the im.save() in the function, or pull the draw.point() out of it. Is there some other way I can solve the problem?</p>
  <pre class="lang-py prettyprint-override"><code>from PIL import Image, ImageDraw
  
  
  im = Image.new(&quot;RGB&quot;, (hor_res, vert_res), (0, 0, 0))
  draw = ImageDraw.Draw(im)
  
  
  def mandelbrot():
      # mandelbrot code
  
  
  def box_renderer(x_start: int, x_end: int, y_start: int, y_end: int):
      for y in range(y_start, y_end):
          for x in range(x_start, x_end):
               colour = 255 - int(255*mandelbrot(x, y)/iterations)
               draw.point([x, y], (0, 0, colour))
  
  
  if __name__ == &quot;__main__&quot;:
      box_renderer(args)
      im.save(&quot;mandelbrot.png&quot;, &quot;PNG&quot;)
      
  </code></pre>
  <p>This is not the entire program, but hopefully enough to make sense</p>