Bug 1197 : Image created with img.get() works incorrectly when using filter()
Last modified: 2009-03-11 08:00




Status:
RESOLVED
Resolution:
DUPLICATE of bug 1198
Priority:
P2
Severity:
normal

 

Reporter:
backspaces
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2009-03-10 21:24
When creating a duplicate image using img.get(), the use of the filter() method works or
doesn't, depending on the order of imaging the initial image and creating the duplicate.

I said it badly, but the attached code shows the problem. First run as is, and it will operate
as I expected. Flip the boolean showBug to true, and the filter call on the duplicate will not
take effect.

Revision: 1.0.1
Mac OS X 10.5.6
Code attached
Details above.

PImage img = createImage(200, 200, RGB);
boolean showBug = false;

void setup() {
size(img.width*2, img.height*2);
img.loadPixels();
for(int i = 0; i<img.pixels.length; i++)
img.pixels[i] = i % 256;
img.updatePixels();
noLoop();
}

void draw() {
PImage img1;
if (showBug) {
image(img,0,0); // Call image first
img1 = img.get();
}
else {
img1 = img.get(); // make duplicate image first
image(img,0,0);
}
image(img1,width/2,0);

img1.filter(THRESHOLD);
image(img,0,height/2);
image(img1,width/2,height/2);
}
Additional Comment #1 From fry 2009-03-11 08:00


*** This bug has been marked as a duplicate of 1198 ***