I’m, trying to save two gif images with transparent backgrounds. The program runs once and does not need to loop. See a reduced program below. There is no line in the 1st image while the 2nd image has the line.
Why is the first image not saving properly ?
PGraphics pg;
void settings() {
size(600, 600, P2D);
}
void setup() {
pg = createGraphics(600, 600, P2D);
pg.beginDraw();
pg.clear();
pg.stroke(90);
pg.line(50, 50, 550, 550);
// do a whole lot more drawing
pg.endDraw();
pg.save("1.png");
pg.beginDraw();
pg.clear();
pg.stroke(120);
pg.line(550, 50, 50, 550);
// do a whole lot more drawing
pg.endDraw();
pg.save("2.png");
println("done");
}