# Annoying Dots in Snapshots on Volume Render

**URL:** https://discourse.vtk.org/t/annoying-dots-in-snapshots-on-volume-render/7535
**Category:** Support
**Created:** [December 31, 2021, 1:48am UTC](https://discourse.vtk.org/t/annoying-dots-in-snapshots-on-volume-render/7535 "2021-12-31T01:48:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tigerhu7](https://discourse.vtk.org/user_avatar/discourse.vtk.org/tigerhu7/32/7613_2.png) [@tigerhu7](https://discourse.vtk.org/u/tigerhu7)
#### Post date: [December 31, 2021, 1:48am UTC](https://discourse.vtk.org/t/annoying-dots-in-snapshots-on-volume-render/7535/1 "2021-12-31T01:48:38Z")

</div>

I have an issue on taking snapshots on volume render visualization.  
The following is my procedure.  
[1] add renderer  
ren1 = vtk.vtkRenderer()  
ren1.AddVolume(volume)  
ren1.SetBackground(0,0,0)  
ren1.GetActiveCamera().Azimuth(theta)  
ren1.ResetCamera()  
ren1.ResetCameraClippingRange()

[2] add render window  
renWin = vtk.vtkRenderWindow()  
renWin.AddRenderer(ren1)  
renWin.SetSize(600, 600)

[3] add windowto\_image\_filter  
windowto\_image\_filter = vtk.vtkWindowToImageFilter()  
windowto\_image\_filter.SetInput(renWin)  
windowto\_image\_filter.SetScale(1)  
windowto\_image\_filter.SetInputBufferTypeToRGBA()  
windowto\_image\_filter.ReadFrontBufferOff()  
windowto\_image\_filter.Update()

[4] save to image  
writer = vtk.vtkPNGWriter()  
writer.SetFileName(pngname)  
writer.SetInputConnection(windowto\_image\_filter.GetOutputPort())

In the VTK interactive window, I got the following result

 ![图片](https://discourse.vtk.org/uploads/default/original/2X/a/a1d7097ad4a20549144f2c3b896eefab4325ce99.jpeg)

but the generated PNG image, I got the following ( notice lots of dots, needed to get rid of )

 ![图片](https://discourse.vtk.org/uploads/default/original/2X/2/264c2f3955ac805b7c95ac2cea7cb187dc6bf746.jpeg)

Does anyone have idea what these dots are? And how can they be removed???

Thanks in advance

---

<div class="post-metadata">

### Author: ![tigerhu7](https://discourse.vtk.org/user_avatar/discourse.vtk.org/tigerhu7/32/7613_2.png) [@tigerhu7](https://discourse.vtk.org/u/tigerhu7)
#### Post date: [December 31, 2021, 1:58am UTC](https://discourse.vtk.org/t/annoying-dots-in-snapshots-on-volume-render/7535/2 "2021-12-31T01:58:55Z")

</div>

I doubt if rendering process was not finished when taking snapshots PNG images.

I tried to add renWin.Start() and renWin.WaitForCompletion() in [2],  
but it didn’t remove those annoying dots.
