# Line width looks thinner with p5 vs canvas api

**URL:** <https://discourse.processing.org/t/line-width-looks-thinner-with-p5-vs-canvas-api/38764>\
**Category:** p5.js\
**Created:** [September 14, 2022, 11:46pm UTC](https://discourse.processing.org/t/line-width-looks-thinner-with-p5-vs-canvas-api/38764 "2022-09-14T23:46:35Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [September 15, 2022, 9:08pm UTC](https://discourse.processing.org/t/line-width-looks-thinner-with-p5-vs-canvas-api/38764/3 "2022-09-15T21:08:12Z")

</div>

Hello,

Related topic:

> [@strokeWeight(1) draws 2 pixel width](https://discourse.processing.org/t/strokeweight-1-draws-2-pixel-width/23425/2):
>
> Hello, My exploration of this with with Google Chrome. My test code: function setup() { print(pixelDensity()); createCanvas(720, 400); background(0); //noSmooth(); translate(50, 0); stroke(255); for (let i=0; i\<21; i++) { strokeWeight(i); line(30\*i, height-50, 30\*i, 50); point(30\*i, 25); } } Reference: [https://p5js.org/reference/#/p5/strokeWeight](https://p5js.org/reference/#/p5/strokeWeight) StrokeWidth() 0 to 20 for points and lines (expand the image for detail): slight_smile

`:)`

---

_[View the full topic](https://discourse.processing.org/t/line-width-looks-thinner-with-p5-vs-canvas-api/38764)._
