# Thick strokes overlap with stray pixels

**URL:** <https://discourse.processing.org/t/thick-strokes-overlap-with-stray-pixels/17865>\
**Category:** Coding Questions\
**Created:** [February 16, 2020, 4:01pm UTC](https://discourse.processing.org/t/thick-strokes-overlap-with-stray-pixels/17865 "2020-02-16T16:01:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgt\_slaughtermelon](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sgt_slaughtermelon/32/8100_2.png) [@sgt\_slaughtermelon](https://discourse.processing.org/u/sgt_slaughtermelon)\
**Post date:** [February 16, 2020, 4:01pm UTC](https://discourse.processing.org/t/thick-strokes-overlap-with-stray-pixels/17865/1 "2020-02-16T16:01:50Z")

</div>

Okay, so I have some code that is meant to draw a series of thick strokes of random color that overlay eachother. The problem is that when they draw, they should theoretically overlap perfectly, but instead there are consistently “seam” looking lines along the side. I’ve tried the hint to draw better lines, tried noSmooth - I mean, in theory they should seamlessly overlap, right?

```auto

color [] palette = {
  #000000, #FF0000, #FF0F00, #FFFF00, #FF00FF, #F0FF00
};
int palette_selector;
int drag;

void setup(){
  size(500,1500);
  background(#FFFFFF);
}
void draw(){
  int c = 0;
  
  while (c < 50){
    palette_selector = (int)random(0,6);
    strokeCap(SQUARE);
    strokeWeight(50);
    stroke(palette[palette_selector]);
    line(50,50+drag, 150,50+drag);
    drag = drag +30;
    c++;
  }
}
    

```

![seam](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/0/0a0053ecc835a8930681eab88cb8d4d0ec151a1b.png)

---

<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:** [February 16, 2020, 7:06pm UTC](https://discourse.processing.org/t/thick-strokes-overlap-with-stray-pixels/17865/2 "2020-02-16T19:06:53Z")

</div>

Hello,

I do not see the “seam” with:

```auto
  size(400, 600); //FX2D, JAVA2D (default), P2D, P3D
  noSmooth();

```

and no “seam” with P2D or P3D:

```auto
  size(400, 600, P2D); //FX2D, JAVA2D (default), P2D, P3D
  //noSmooth();

```

References:  
[https://processing.org/reference/noSmooth\_.html](https://processing.org/reference/noSmooth_.html)  
[https://processing.org/reference/smooth\_.html](https://processing.org/reference/smooth_.html)

’ 🙂 ’
