I am looking for a fast algorithm that draws lines with a specific thickness. Lines should not be smoothed, speed is a priority. Something pretty simple, as it would be enough:

A use case is a Javascript game in which worms leave trails. (HTML5 Canvas clearly draws lines, but getImageData () is very slow and thus collision detection)
I could not find anything that would do this for the last 2.5 hours. And yes, I know that there are almost the same questions on SO, in fact there are quite a lot of them, but none of them have a working solution. The only solution I currently have is to draw circles along the Bresenham line, which is not very efficient.
Some code (pseudo-code, JS, or at least a link to an article) will be great.
javascript algorithm graphics line drawing
blade
source share