i'm loading a series of .png files that have an alpha channel, then rotating and scaling them etc. and i want to output the final composition, which will be fairly large in the end ~3000pixels x ~3000pixels, while also maintaining the original alpha channel.
i've looked into createGraphics(), createImage() and PGraphics() examples for saving/outputting large files, but i can't seem to grasp how i can use these to save/output loaded image files with alpha channels.
here's the example from
http://dev.processing.org/reference/core/javadoc/processing/core/PApplet.html#cr... Code:
PGraphics big;
void setup() {
big = createGraphics(3000, 3000, P3D);
big.beginDraw();
big.background(128);
big.line(20, 1800, 1800, 900);
// etc..
big.endDraw();
// make sure the file is written to the sketch folder
big.save("big.tif");
}
here's a simple version of what i'm doing
Code:
PImage[] bild;
PGraphics big;
void setup() {
size(600,600);
big = createGraphics(3000, 3000, P3D);
bild = new PImage[4];
bild[0] = loadImage("image_00.png");
bild[1] = loadImage("image_01.png");
bild[2] = loadImage("image_02.png");
bild[3] = loadImage("image_03.png");
}
void draw() {
background(255);
big.beginDraw();
//big.background(128);
translate(width/2,height/2);
for(int i=0; i!=bild.length; i++) {
rotate(radians(360/bild.length));
//scale( map(mouseX, 0,width, 0.0, 2.0) );
rotate( radians( map(mouseY, 0,height, 0,360) ) );
image(bild[i], 0,0);
/*
// i know this doesn't work,
// but something like is necessary right?
big.image(bild[i], 0,0);
*/
}
big.endDraw();
}
void speichern() {
//saving functions here
big.save("big.png");
}
void keyPressed() {
if(key == 's') {
println("saving");
speichern();
}
}
does what i'm asking make sense? any help is much appreciated.
thanks.
Ken