# Help! How create a "depth map" using ParaView (Is it possible)

**URL:** https://discourse.paraview.org/t/help-how-create-a-depth-map-using-paraview-is-it-possible/738
**Category:** ParaView Support
**Created:** [October 16, 2018, 8:38am UTC](https://discourse.paraview.org/t/help-how-create-a-depth-map-using-paraview-is-it-possible/738 "2018-10-16T08:38:47Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Michael](https://discourse.paraview.org/user_avatar/discourse.paraview.org/michael/32/16_2.png) [@Michael](https://discourse.paraview.org/u/Michael)
#### Post date: [October 16, 2018, 3:38pm UTC](https://discourse.paraview.org/t/help-how-create-a-depth-map-using-paraview-is-it-possible/738/2 "2018-10-16T15:38:05Z")

</div>

Hi,  
There is probably a easier way to do it but here is a solution using VTK python bindings:

```python
import vtk
ss = vtk.vtkWindowToImageFilter()
ss.SetInputBufferTypeToZBuffer()
ss.SetInput(GetActiveView().SMProxy.GetRenderWindow())
writer = vtk.vtkXMLImageDataWriter()
writer.SetInputConnection(ss.GetOutputPort())
writer.SetFileName('/tmp/capture.vti')
writer.Write()

```

More information here: [https://www.vtk.org/doc/nightly/html/classvtkWindowToImageFilter.html](https://www.vtk.org/doc/nightly/html/classvtkWindowToImageFilter.html)

Cheers,  
Michael

---

_[View the full topic](https://discourse.paraview.org/t/help-how-create-a-depth-map-using-paraview-is-it-possible/738)._
