[vtkusers] Saving image with transparent background from Qt

Andras Lasso lasso at queensu.ca
Tue Mar 6 13:48:43 EST 2018


Thank you, this is very useful.

Is this a temporary workaround only or this is going to be the permanent solution? For augmented reality applications, where we need to generate transparent overlays at high refresh rate, this method would be quite expensive.

Andras

-----Original Message-----
From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Ben Boeckel
Sent: Tuesday, March 6, 2018 12:51 PM
To: Ignacio Fernández Galván <jellby at yahoo.com>
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] Saving image with transparent background from Qt

On Tue, Mar 06, 2018 at 17:45:41 +0100, Ignacio Fernández Galván via vtkusers wrote:
> Can anyone get it to work?

ParaView does it this way:

    https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.kitware.com%2Fparaview%2Fparaview%2Fblob%2Fmaster%2FParaViewCore%2FServerManager%2FRendering%2FvtkSMViewProxy.cxx%23L474&data=02%7C01%7Classo%40queensu.ca%7C816570f239464bee4db208d5838accbc%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636559554522056640&sdata=DvMY2JMDZOVSRsTDdtq7eL4lrvOV2G2Ntlu0YW7GG3k%3D&reserved=0

Basically it screenshots twice, once with a black background and again with a white background to figure out what is "visible" and subtracts them.

--Ben
_______________________________________________
Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C816570f239464bee4db208d5838accbc%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636559554522056640&sdata=T1Zj8DuUo8d3%2FiNF1a%2BLigsRT1%2FFtC0FIyDM8ZPRFCM%3D&reserved=0

Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7C816570f239464bee4db208d5838accbc%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636559554522056640&sdata=lYsQQAbTPFCkTfHJrzl1gb3w8zv81%2B%2BBrE5oiJij10c%3D&reserved=0

Please keep messages on-topic and check the VTK FAQ at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7C816570f239464bee4db208d5838accbc%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636559554522056640&sdata=9Bt8An%2BX9nv1ZGL4JFgbFX0X3n0yp2UVMXTbVp4Bu0g%3D&reserved=0

Search the list archives at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7C816570f239464bee4db208d5838accbc%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636559554522056640&sdata=Z%2BJYXyKeyPojZ0HsspLU62rM6Nk%2BGFJfpCeoyTpgHfw%3D&reserved=0

Follow this link to subscribe/unsubscribe:
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.org%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7C816570f239464bee4db208d5838accbc%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636559554522056640&sdata=g54vVgm5lC5jX0rNkpJQsZsNbQzH5iyqx%2BQLBXjgGb0%3D&reserved=0


More information about the vtkusers mailing list