NullPointerException when calling save() after surface.setSize() in P2D

I’m guessing here (because you didn’t share the code that caused this), but my guess is that you put background() in setup, then you put ellipse in draw and let it run.

Yep, that’s exactly what happened.

Don’t do that if you want antialiased edges – if you draw transparent pixels over and over and over again, after a few dozen frames they white-out. Instead, put background in draw if you intend to composite antialiased shapes.

Oh, sure! Seeing it explained that way, it makes perfect sense. Thanks.

Any idea why applying a mask to the image with a transparent background led to a similar effect?