title: Algorithm for drawing line with thickness / width
body: <p>I'm looking for a fast algorithm that draws lines with a certain thickness. The lines don't have to be antialiased, speed is priority. Something fairly simple like this would suffice:</p>
  
  <p><img src="https://i.stack.imgur.com/gWpLL.png" width="300"></p>
  
  <p>The use case is a Javascript game where worms leave trails. (HTML5 Canvas obviously draws lines, but getImageData() is very slow and so is collision detection)</p>
  
  <p>I couldn't find anything that does this for the last 2.5 hours. And yes, I'm aware that there are almost identical questions on SO, quite a lot of them in fact, but not a single one has a working solution. The only solution I currently have is to draw circles along a Bresenham line, which is not very efficient.</p>
  
  <p>Some code (pseudo-code, JS or at least a link to an article) would be great.</p>