Sorry if this is a bit late, but your solution only seems to work with a white background, not with a black one.
Im trying to get is to work with my p5 sketch as in this post:
https://discourse.processing.org/t/trails-with-background-transparency/17139/3?u=skranker
Here is your solution with the white background that works perfectly:
And here i am trying to do the same thing with a black background:
The background color turns to (205, 205, 205) for some reason and the transparency is not applied at all.