Hi,
I'm having trouble successfully running a sketch which is any bigger than 2700 X 2700 pixels.
This sketch reads pixels data from an image, and draws a triangle for each pixel based on that pixels RGB values. Here is an older version to give you an idea of what is going on: http://friendly.verywhere.org/josh/portfolio/colortriangles2.html
Everything is fine until I start to go big. I was once able to run the sketch at 3000 X 3000 and create a .tiff file. Now, I can't even create a blank sketch at 3000 X 3000, because I keep getting java.lang.OutOfMemoryError. I am running on a dual processor G5 with 1GB of RAM. Is this an issue with the computer or the limitations of Processing?
My ultimate goal is to create a giant .tiff file which I could print 40" X 40" at 300 DPI. In theory I could use AIExport, but these are big images that I am reading in (500KB+), and I don't know if Illustrator could handle such a huge file.
Anyone know how I can make this happen?
Code:
size(3000, 3000);
background(255);
PImage d = loadImage("DSC_0013.jpg");
color b;
for(int i=0; i<d.width*d.height; i++){
b = d.pixels[i];
int n=5;
int x1 = width/2;
int y1 = int(height/2-(red(b)*n));
int x2 = int(width/2-(green(b)*n)*cos(PI/6));
int y2 = int(height/2+(green(b)*n)*sin(PI/6));
int x3 = int(width/2+(blue(b)*n)*cos(PI/6));
int y3 = int(height/2+(blue(b)*n)*sin(PI/6));
stroke(red(b),green(b),blue(b),25);
noFill();
smooth();
triangle(x1,y1,x2,y2,x3,y3);
}
save("dad_alaska2.tiff");