title: How do I properly set DPI when saving a pillow image?
body: <p>I am trying to create images programatically on Python using <a href="https://github.com/python-pillow/Pillow" rel="noreferrer" title="Pillow">Pillow library</a> but I'm having problems with the image quality of the text inside the image.</p>
  
  <p>I want to save the Image the I generate to PNG, so I'm setting the DPI when saving according to <a href="http://pillow.readthedocs.org/en/latest/handbook/image-file-formats.html#png" rel="noreferrer" title="Pillow docs">this</a>, but whether I save with <em>dpi=(72,72)</em> or <em>dpi=(600,600)</em> it visually looks the same.</p>
  
  <p>My code for doing it is the following:</p>
  
  <pre><code>from PIL import Image, ImageDraw, ImageFont
  
  def generate_empty_canvas(width, height, color='white'):
      size = (width, height)
      return Image.new('RGB', size, color=color)
  
  def draw_text(text, canvas):
      font = ImageFont.truetype('Verdana.ttf', 10)
      draw = ImageDraw.Draw(canvas)
      if '\n' not in text:
          draw.text((0, 0), text, font=font, fill='black')
      else:
          draw.multiline_text((0, 0), text, font=font, fill='black')
  
  def create_sample():
      text = 'aaaaaaaaaaaaaaaaaa\nbbbbbbbbbbbbbbbbbbbbbbb\nccccccccccccccccccccc'
      canvas = generate_empty_canvas(200, 50)
      draw_text(text, canvas)
      canvas.save('low_quality.png', dpi=(72, 72))
      canvas.save('high_quality.png', dpi=(600, 600))
  </code></pre>
  
  <p>The low_quality.png is:</p>
  
  <p><img src="https://i.stack.imgur.com/kdqnn.png" alt="Image dpi=72"></p>
  
  <p>The high_quality.png is:</p>
  
  <p><img src="https://i.stack.imgur.com/fNnpW.png" alt="Image dpi=600"> </p>
  
  <p>As it's visible by the images the quality didn't change.
  What am I doing wrong here?</p>
  
  <p><strong>Where do I set the DPI so that the image really has dpi=600?</strong></p>