We often export images of the simulation models. However, we need the images without a background. Removing the floor/grid is a first step, but is it possible to create an image of the models and have the rest of the image as a transparent background? Or is this something that would be possible in the future?
I do this with an workaround:
Set the background-color in VC to one color which is almost unique compared to colors on components.
Save the picture
gimp: how to make a transparent background | Thomas Cokelaer's blog
Hope that helps?
Another approach is to export the model as 3MF or OBJ
Then open the 3MF or OBJ in Paint 3D and save as PNG with transparency
The appearance of the model won’t be exactly the same as in VC, but for many cases it’s good enough.
Thanks for the recommendations!
At the moment, we are using the suggestion of captain_feature, but were looking for a method that would be more efficient. With a lot of images, it can be a time consuming task. We’ll stick to this method for now and see if a functionality like that might be introduced in a later version of Visual Components .
The Blender addon has this feature, here’s a video of it in action (in the last minute or so of the video):
A new improved version of this addon was just released today. Please find the download link in the original post (top most post) in this forum thread. Please report here (on this thread) if you find any bugs or other issues.
The new 2.1.0 version mainly improves the reliability and performance of the addon. It’s a lot faster with heavier CAD models.
There’s also some new features that are listed in the original post EDIT5 section. One of the new features is a shadow catcher floor, that I’d lik…
Use vcApplication.saveBitmap() command to auto export the image for every X seconds or manually click.
The Blender addon seems like a good solution, thanks!
With the vcApplication.saveBitmap() command I don’t know how to make sure that the background is invisible. I just get the exact image that is on the screen, including the background.
Oh, OK, I see, my bad.
Need to handle transparency after saveBitmap().
I found that it is not hard to handle image transparency.
Since can use PIL in VC.
from PIL import Image
png = Image.open("D:\\sample.png")
png = png.convert("RGBA")
data = png.getdata()
newData = 
# Choose white pixel here
for item in data:
if item == 255 and item == 255 and item == 255:
newData.append((255, 255, 255, 0))
@chungmin Thanks! This also seems like a clean and easy to use solution!