# Strange pixels with point()

**URL:** <https://discourse.processing.org/t/strange-pixels-with-point/30659>\
**Category:** Processing\
**Created:** [June 12, 2021, 8:47am UTC](https://discourse.processing.org/t/strange-pixels-with-point/30659 "2021-06-12T08:47:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![maze](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@maze](https://discourse.processing.org/u/maze)\
**Post date:** [June 12, 2021, 8:47am UTC](https://discourse.processing.org/t/strange-pixels-with-point/30659/1 "2021-06-12T08:47:17Z")

</div>

Drawing points with float positions doesn’t seem to round correctly in special situations.  
It seems that sometimes two points are rendered instead of one.

```auto
  stroke(0);
  strokeWeight(3);
  point(10, 19.9999);
  point(15, 20);
  point(9.9999, 30);
  point(10, 35);

```

results in:

 ![bild 59](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/c/c7643a59725e98a4cedd9cd35672cd18ffebbbf2.png)

Very confusing. Any ideas?

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [June 12, 2021, 9:04am UTC](https://discourse.processing.org/t/strange-pixels-with-point/30659/2 "2021-06-12T09:04:39Z")

</div>

Try noSmooth(); ?

Chrisir

---

<div class="post-metadata">

**Author:** ![maze](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@maze](https://discourse.processing.org/u/maze)\
**Post date:** [June 12, 2021, 9:12am UTC](https://discourse.processing.org/t/strange-pixels-with-point/30659/3 "2021-06-12T09:12:41Z")

</div>

Same result.  
It also seems that the floats are not rounded to integer position.  
When I change the value of 19.9999 to 19.999, I will get a **single** pixel, in the y-position of 19.

---

<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:** [June 12, 2021, 9:32am UTC](https://discourse.processing.org/t/strange-pixels-with-point/30659/4 "2021-06-12T09:32:30Z")

</div>

Hello,

The other renderers give different results:

```auto
void setup() 
  {
  size(640, 360, JAVA2D); //This is the default
  //size(640, 360, FX2D);
  //size(640, 360, P2D);
  //size(640, 360, P3D);
  stroke(0);
  strokeWeight(3);
  point(10, 19.9999);
  point(15, 20);
  point(9.9999, 30);
  point(10, 35);
  }

```

I can’t answer why but them a try!

`:)`

---

<div class="post-metadata">

**Author:** ![maze](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@maze](https://discourse.processing.org/u/maze)\
**Post date:** [June 12, 2021, 10:13am UTC](https://discourse.processing.org/t/strange-pixels-with-point/30659/5 "2021-06-12T10:13:19Z")

</div>

@chrisir @glv thanks for your answers.  
I tried the other renderers, indeed different outputs.  
The JAVA2D must have a bug: Why should there be a difference between the values of .9999 and .999 ?
