So, I want to create a PGraphics object with some transparent regions and everything else black, but I can only find the regions that are transparent. Is there any way for me to do something like:
Such that the ellipse replaces all the pixels in it’s region instead of being drawn on top of the black background? Or would I have to go through each pixel and change their colors individually?
Not sure were you are stuck at. The previous example provides a good demonstration of using mask on PGraphics. You are referring to a generalized form which it is not clear from the information you have provided so far.
It would be:
void updateMask() {
mask.beginDraw();
mask.background(0);
mask.fill(255);
float s = 0.2; // 20% of the dimension
mask.ellipse(mask.width/2, mask.height/2, mask.width*s, mask.height*s);
mask.endDraw();
}