<div dir="ltr">Hmm,<div>I tried </div><div>~/ParaView-4.3.1-Linux-64bit/bin/pvpython test.py<br></div><div><br></div><div>and still created the right png - see attached.</div><div>I notice you have a different color palette. Why is that?</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 14, 2015 at 8:11 AM, Ruggiero Guida <span dir="ltr"><<a href="mailto:ruggiero.guida@gmail.com" target="_blank">ruggiero.guida@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks Dan.<div><br></div><div>Run you script through pvpython. No modifications apart from the filenames. I still have an image with 1000x855 size (see attached).</div><div><br></div><div>I will try to build paraview from source to see if this changes.</div><div><br></div><div>Thanks</div><div><br></div><div><img src="cid:ii_14fcbc329fdf6974" alt="Inline images 1" width="375" height="362"><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 12 September 2015 at 02:04, Dan Lipsa <span dir="ltr"><<a href="mailto:dan.lipsa@kitware.com" target="_blank">dan.lipsa@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ruggiero,<div>Attached is the script I used on ParaView master. It saves a 1000x1000 png. I had to uncomment renderView1.ViewSize and change the magnification for SaveScreenshot to 1.</div><span><font color="#888888"><div><br></div><div>Dan</div><div><br></div><div><br></div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 10, 2015 at 9:38 PM, Ruggiero Guida <span dir="ltr"><<a href="mailto:ruggiero.guida@gmail.com" target="_blank">ruggiero.guida@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Attached. Thanks for checking. </div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 11 September 2015 at 09:34, Dan Lipsa <span dir="ltr"><<a href="mailto:dan.lipsa@kitware.com" target="_blank">dan.lipsa@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">If you send me your test.vtk I can try to generate the script on my machine.<span><font color="#888888"><div><br></div><div>Dan</div><div><br></div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 10, 2015 at 9:10 PM, Ruggiero Guida <span dir="ltr"><<a href="mailto:ruggiero.guida@gmail.com" target="_blank">ruggiero.guida@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I am using the 4.3.1 binary version downloaded from the website. I generated my script starting from the trace as you suggest. Uncommenting the ViewSize on your script works. The fact is that it does not work on mine and i really don't understand why. I guess it is related to the settings of the camera.<div><br></div><div>Have you tried to run my script on your machine? I would expect to have a square image with the data fitted perfectly into it, but as soon as I increase the ViewSize above 855x855, only the horizontal size increases. As you can see from the VTK the source data is 24x24.</div><div><br></div><div>Thanks</div><div><br><div><br></div></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 11 September 2015 at 08:51, Dan Lipsa <span dir="ltr"><<a href="mailto:dan.lipsa@kitware.com" target="_blank">dan.lipsa@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>What version of ParaView do you use? I run the script on a ParaView source build from git master.</div><div><br></div><div><br></div><div>You should be able to do Tools / Start Trace, open your file and then save it to the desired resolution. The script generated should tell you what settings you need. You might need to uncomment the setting of the ViewSize. This is what I had to do.</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 10, 2015 at 6:41 PM, Ruggiero Guida <span dir="ltr"><<a href="mailto:ruggiero.guida@gmail.com" target="_blank">ruggiero.guida@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks Dan.<div><br></div><div>The image saved is 648 x 639 (see attached). What I am not understanding is the relation between ViewSize, camera settings and actual image size in pixels.</div><div><br></div><div>I would like to use paraview to render some textures that I will be using in my code and I need the image ti fit perfectly the content.</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 10 September 2015 at 23:19, Dan Lipsa <span dir="ltr"><<a href="mailto:dan.lipsa@kitware.com" target="_blank">dan.lipsa@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ruggiero,<div>The following script saves a 100x100 sphere.</div><div>I created it using the trace option in ParaView.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Thu, Sep 10, 2015 at 5:07 AM, Ruggiero Guida <span dir="ltr"><<a href="mailto:ruggiero.guida@gmail.com" target="_blank">ruggiero.guida@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div>I am trying to create a screenshot of a specific size from a [VTK file][1].</div><div>This is the code I am using</div><div><br></div><div>    from paraview.simple import *</div><div>    paraview.simple._DisableFirstRenderCameraReset()</div><div>    rad_map = LegacyVTKReader(FileNames=['test.vtk'])</div><div>    </div><div>    # get active view</div><div>    renderView1 = GetActiveViewOrCreate('RenderView')</div><div>    dpi = 70</div><div>    heigth = 24.39846235421442</div><div>    width = 24.398462354214413</div><div>    width_p = int(width * dpi)  </div><div>    heigth_p = int(heigth * dpi)</div><div>    renderView1.ViewSize = [width_p, heigth_p]</div><div>    </div><div>    # reset view to fit data</div><div>    #renderView1.ResetCamera()</div><div>    </div><div>    # current camera placement for renderView1</div><div>    renderView1.CameraParallelProjection = 1</div><div>    renderView1.CameraPosition = [5, 5, 1000]</div><div>    renderView1.CameraFocalPoint = [5, 5, 0.0]</div><div>    renderView1.CameraViewUp = [0.0, 1.0, 0.0]</div><div>    scale = (heigth) / 2.0</div><div>    renderView1.CameraParallelScale = scale</div><div>    </div><div>    Render()</div><div>    SaveScreenshot("/Users/ruggiero/dev/test.png", magnification=1)</div><div><br></div><div>The problem is that the `ViewSize` seems to be ignored and I keep having images of fixed size 1707 × 855. The height 855 seems to be a kind of limit; the only way to get what I want is to limit the `ViewSize` to 855x855.</div><div><br></div><div>I have checked [this][2] question and [this][3] question, but with no success.</div><div><br></div><div>Any idea? I am not very confident in the settings for the camera. Could this be the issue? </div><div><br></div><div><br></div><div>  [1]: <a href="https://dl.dropboxusercontent.com/u/1342856/test.vtk" target="_blank">https://dl.dropboxusercontent.com/u/1342856/test.vtk</a></div><div>  [2]: <a href="http://stackoverflow.com/questions/31930448/in-python-script-for-paraview-can-i-specify-the-resolution-when-i-do-a-savescre" target="_blank">http://stackoverflow.com/questions/31930448/in-python-script-for-paraview-can-i-specify-the-resolution-when-i-do-a-savescre</a></div><div>  [3]: <a href="http://stackoverflow.com/questions/27430588/paraview-python-command-to-save-picture-of-defined-size" target="_blank">http://stackoverflow.com/questions/27430588/paraview-python-command-to-save-picture-of-defined-size</a></div></div>
<br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>