Simulating hand drawing on canvas
-
28-10-2019 - |
Pergunta
Is there a JavaScript library that simulates the canvas element but instead of creating straight lines, the lines created look 'free-form' or 'hand drawn'?
This would be very cool if it existed and it seems like someone should have already done it. Also if there are articles on the math involved in this, I would be interested because then I could try to implement this library myself.
Solução
I remember reading something about doing this a couple of years ago. Incidentally that article was doing it in javascript on canvas. The idea was basically to draw the lines yourself pixel-by-pixel using something like Bresenham's line drawing algorithm but modify it to add some random deviations/pertubations in the line.
I'm not sure if this was the page I was reading at the time but this is what google brought up today: http://29a.ch/2010/2/10/hand-drawn-lines-algorithm-javascript-canvas-html5