#6 When background graphic includes transparency, exports layer

open
nobody
None
5
2013-12-09
2012-11-07
Lester Ward
No

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).

Discussion

  • Lester Ward
    Lester Ward
    2013-12-09

    I have created a patch to properly support transparent backgrounds, which solves this problem. For export formats that don't support transparency, the background is made white. The patch is fairly simple and can be found here:

    http://thor.divnull.com/pub/code/lpub-transparency.patch