Copy() bug, pixel bleeding lower half of the screen

Hi, i’m trying to make some analog-like video feedback effects using the copy() function.
copy(sx, sy, sw, sh, dx, dy, dw, dh) s=source, d=destination

When copying the screen and scaling it by some pixels, making a scaled duplicate of the content behind itself, the lower half of the screens begins a “bleeding river” of pixels. I’m trying to find a logic behind but it feels like it’s just a bug. Could you guys help me?

int a=10;

public void setup() {
  size(1000, 1000);
   fill(255, 10);
   stroke(255, 0, 150);

public void draw() {
//i want to copy the content on the center on the screen and make it a little bigger on the background
copy(a,a,width-a*2,height-a*2,0,0,width,height); //(0,0,width,height,-a,-a,width+a*2,height+a*2) has the same issue

Hello @rroarrg,

Here is a related topic:

Try different renderers:

int a = 10;

void setup()
  size(600, 600); //Default
  //size(600, 600, JAVA2D); //Default and same as size(600, 600);
  //size(600, 600, P2D);
  //size(600, 600, P3D);
  //size(600, 600, FX2D);
  //noSmooth(); // Try this
  // Curious:

void draw() 
  copy(a, a, width-a*2, height-a*2, 0, 0, width, height); 
  circle(width/2, height/2, 100);
  //copy(a, a, width-2*a, height-2*a, 0, 0, width, height); 

I don’t have an answer to why this happens with JAVA2D.



1 Like