Create a PNG graphic that includes some transparency (e.g. make a 1000x1000 image that is nothing but transparent pixels). Use this as your background image. Export PNG files. As each file is exported, it includes the images from the previous steps, all layered on top of each other.
I'm pretty sure what the export code is doing is something like this:
1) Allocate a buffer.
2) "Clear" the buffer by painting on the background image.
3) Draw the step into the buffer
4) Export the buffer to a file.
5) Go to step 2 to draw the next step.
This only works if the graphic you use is opaque. If it is transparent, then painting the graphic to the buffer doesn't "clear" the buffer at all. You need an explicit erase step (or allocate a new buffer each time).