I have created a project using the JavaScript library P5.js and used its built-in line() and ellipse() functions to draw lines and circles to a canvas. I am now attempting to remove the entirety of P5.js and its functions from my project to leave pure JavaScript however when I replace P5s line and ellipse functions with JavaScripts ctx.LineTo and ctx.arc I do not get the same results.
The drawings created with the P5.js Library look much sharper and high resolution.
The image below was created using P5.js line() and ellipse() functions.
This image however, was created using pure JavaScript and as you can see it looks much worse.
Using pure JavaScript I have set the line width to be the thinnest possible however it still looks thicker and fuzzier than the P5.js version.
How can I draw lines using pure JavaScript exactly how the P5.js Library does to get the same sharp, crisp result?
The Javascript I am using currently is as follows:
ctx.beginPath();
ctx.moveTo(30, 40);
ctx.lineTo(60, 90);
ctx.strokeStyle = 'white';
ctx.lineWidth = 0.1;
ctx.stroke();
This question post was labelled as a duplicate of another question however the "duplicate" question does not solve my issue as I stated I have tried adding .5 onto to coordinate values that that doesn't work.