# Capturing screenshot of ray traced object from python script

**URL:** https://discourse.paraview.org/t/capturing-screenshot-of-ray-traced-object-from-python-script/10262
**Category:** ParaView Support
**Created:** [September 7, 2022, 1:42pm UTC](https://discourse.paraview.org/t/capturing-screenshot-of-ray-traced-object-from-python-script/10262 "2022-09-07T13:42:01Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Akro](https://discourse.paraview.org/user_avatar/discourse.paraview.org/akro/32/9865_2.png) [@Akro](https://discourse.paraview.org/u/Akro)
#### Post date: [September 7, 2022, 1:42pm UTC](https://discourse.paraview.org/t/capturing-screenshot-of-ray-traced-object-from-python-script/10262/1 "2022-09-07T13:42:01Z")

</div>

Hi,  
I’m trying to run a python script that renders a mesh by using ray tracing (either OSPRay or OptiX) engine, followed by screen capturing of the rendered window. My problem is that the rendering process takes some time, and the screenshot is being taken before the rendering ends. As a result, the captured image is low quality. What would be the way to solve this?  
Many thanks for your help

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [September 8, 2022, 6:19am UTC](https://discourse.paraview.org/t/capturing-screenshot-of-ray-traced-object-from-python-script/10262/2 "2022-09-08T06:19:27Z")

</div>

> [@Akro](#):
>
> and the screenshot is being taken before the rendering ends.

That does not sound possible. Did you try increasing the number of sample per pixel ?

---

<div class="post-metadata">

### Author: ![Akro](https://discourse.paraview.org/user_avatar/discourse.paraview.org/akro/32/9865_2.png) [@Akro](https://discourse.paraview.org/u/Akro)
#### Post date: [September 8, 2022, 7:09am UTC](https://discourse.paraview.org/t/capturing-screenshot-of-ray-traced-object-from-python-script/10262/3 "2022-09-08T07:09:18Z")

</div>

Many thanks Matheieu,  
That solved my problem. I have needed much more samples for the OptiX tracer to get an equivalent quality image compared to the ospray tracer.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [September 8, 2022, 7:11am UTC](https://discourse.paraview.org/t/capturing-screenshot-of-ray-traced-object-from-python-script/10262/4 "2022-09-08T07:11:59Z")

</div>

Yes, Optix does not support denoising inside paraview yet.
