Hi All-
I’m attempting to get this fork process, to run over the top of a background image, instead of the default neutral single color. I’ve loaded the image into the sketch data file, and attempted to set it up and draw it, but I just can’t figure out how to connect the dots so that the image displays in the background while the code runs its color process in the foreground. I keep getting a “bg is not defined” error in the log.
https://www.openprocessing.org/sketch/802011
with this reduced code:
PImage bg;
void setup() {
size(1200, 600);
bg = loadImage("BayBridgeSunset_1200x600.png");
}
void draw() {
image(bg,0,0);
if ( frameCount%60 == 0 ) println(nf(frameRate,0,1));
}
it work, but need about 4 sec to load here.
the FPS i see about 35.
the
background(bg);
only ends in error.
You’re using :
PImage = bg;
but that‘s not a correct way to define a variable…
Instead use :
PImage bg;