bwoodsend/vtkplotlib

Background transparency

Closed this issue · 6 comments

Btw, great library!
I was not able to save a 3D mesh into a 2D PNG with transparent background. Tried:

vpl.gcf() is fig 
vpl.mesh_plot(mesh)
fig.background_color = [0, 0., 0., 0.]
vpl.save_fig('fig.png', magnification=1, off_screen=True) 

Did I miss something?
Thanks.

Ahh, now that reminds me that yonks ago, someone went and addressed that and I meant to cherry-pick it but didn't. Hang on whilst I do that...

Ughh, I keep forgetting how much I dislike working on this project. It's like tiptoeing through a minefield made out of seg-faults.

I've got a change ready. Mind giving it a go?

pip install https://github.com/bwoodsend/vtkplotlib/archive/refs/heads/background-opacity.zip

then just rerun your code.

It worked!
The resulting PNG file has a transparent background as requested!
Do you merge the code into the main branch?
Thanks a lot!

Cool, I'll merge it into master then release it then.