Thick strokes overlap with stray pixels

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?


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

1 Like

Hello,

I do not see the “seam” with:

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

and no “seam” with P2D or P3D:

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

References:
https://processing.org/reference/noSmooth_.html
https://processing.org/reference/smooth_.html

:slight_smile:

1 Like