Exporting image with alpha channel (matte)

Feel free to ask any question here
Post Reply
MattG
Posts: 3
Joined: Sat Apr 21, 2018 6:51 pm

Exporting image with alpha channel (matte)

Post by MattG »

Is there a way to export an image with an alpha channel so that the image background would be transparent?
(Render to File feature?)

Thank you for this great software.

MattG
daniel
Site Admin
Posts: 7467
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Exporting image with alpha channel (matte)

Post by daniel »

Not directly sadly. With the default version, you could define a funky color as background (purple for instance) and without any gradient. This way it would be easy to change this color to a transparent one with any image edition software (Paint.net, Photoshop, etc.).

Another programmatic option (but I'm not 100% sure it will work) would be to change the alpha component of the OpenGL 'clear' color to 0 (transparent). You'll simply have to change the call to glClearColor in ccGLWindow.cpp ... and compile CC again ;).
Daniel, CloudCompare admin
MattG
Posts: 3
Joined: Sat Apr 21, 2018 6:51 pm

Re: Exporting image with alpha channel (matte)

Post by MattG »

Hi Daniel, thank you for these interesting options. My skills are however very basics so I don't know how I could edit this OpenGL parameter.

Perhaps the transparency option could be a new feature request - or even inserted into an Image export plugin?

MattG
demetris
Posts: 1
Joined: Wed Apr 26, 2023 10:14 am

Re: Exporting image with alpha channel (matte)

Post by demetris »

Hello!

I was also trying to get a transparent background - zero programming abilities.
Found a way that works ok through Photoshop.


Choose a vibrant color as a background from CC , and render to file.

1. open photoshop: open image -> unlock the image layer and make a new layer underneath it.

2. Open the 'Select' menu from the top bar and choose the color range. Use the eye drop tool from the pop-up window, choose the background color, and use max fuzziness.

3. Now the background is selected - hit delete, and you will have just the scan data on that layer. On the layer you made after opening photoshop, you can use the paint bucket tool or insert any background you need. Alternatively, you can keep it empty and quickly export it as a png to keep the transparency.!

Hope this is helpful,
D
BIANI Patrick
Posts: 3
Joined: Fri Feb 15, 2019 11:01 am

Exporting Mesh with Colors to GLB File

Post by BIANI Patrick »

Process to export a 'Poisson reconstruction' mesh in color to the GLB format
format used for viewers:
GLTF Viewer-Model Editor-Babylon.js Sandbox-or others
-CloudCompare: mesh export in .PLY
-Conversopn from PLY to GLB using the only converter I've found that preserves cloud colors:
https://imagetostl.com/fr/convertir/un- ... ply/en/glb
Have fun !
daniel
Site Admin
Posts: 7467
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Exporting image with alpha channel (matte)

Post by daniel »

Thanks for the tip ;)
Daniel, CloudCompare admin
Post Reply