title: Fix PIL.ImageDraw.Draw.line with wide lines
body: <p>From the PIL Documentation:</p>
  
  <blockquote>
    <p><strong>PIL.ImageDraw.Draw.line(xy, fill=None, width=0)</strong> </p>
    
    <p>Draws a line between the coordinates in the xy list.</p>
    
    <p>Parameters:</p>
    
    <ul>
    <li>xy – Sequence of either 2-tuples like [(x, y), (x, y), ...] or    numeric values like [x, y, x, y, ...].</li>
    <li>fill – Color to use for the    line.</li>
    <li>width – The line width, in pixels. <strong>Note that line joins are not    handled well, so wide polylines will not look good.</strong></li>
    </ul>
  </blockquote>
  
  <p>I'm looking for a fix for this issue. A good solution for me would be to have the line drawn by <code>PIL.ImageDraw</code> have rounded ends (<code>capstyle</code> in <code>TKinter</code>). Is there an equivalent in <code>PIL.ImageDraw</code>?</p>
  
  <p>This is what I would like to obtain:
  <a href="https://i.stack.imgur.com/zpU1Y.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zpU1Y.png" alt="enter image description here"></a></p>
  
  <p>Minimal Working Example:</p>
  
  <pre><code>from PIL import Image, ImageDraw
  
  WHITE = (255, 255, 255)
  BLUE = "#0000ff"
  MyImage = Image.new('RGB', (600, 400), WHITE)
  MyDraw = ImageDraw.Draw(MyImage)
  
  MyDraw.line([100,100,150,200], width=40, fill=BLUE)
  MyDraw.line([150,200,300,100], width=40, fill=BLUE)
  MyDraw.line([300,100,500,300], width=40, fill=BLUE)
  
  MyImage.show()
  </code></pre>
  
  <p>Result from MWE:</p>
  
  <p><a href="https://i.stack.imgur.com/7HR49.png" rel="noreferrer"><img src="https://i.stack.imgur.com/7HR49.png" alt="enter image description here"></a></p>