I haven’t tested or looked at that code carefully, but guesses at some starting points to check for when alpha is disappearing or weirdly flattened –
- repeat drawing without clearing with background (as above)
- compositing multiple frame draws, e.g. keyPressed vs keyReleased
- drawing onto and copying off of the main canvas (which doesn’t support alpha)
- using an RGB PImage rather than ARGB
- blendMode isn’t set correctly