ViewSize not respected in PVSM file

I have a question regarding the ViewSize. I am regularly working from 2 different computers with different screen sizes. When I open a State that was built on the other computer, it looks differently (positions of scales, annotations, …) because of the resolution mismatch. Basically I can only make changes to the state from the computer I built it with, otherwise the images produced are not identical to the ones I received before and I cannot replace all images of the ongoing project again.

We have had this problem ever since we use PV and could not really find a fix. However I stumbled upon the Tools > “Lock View Size” option recently and it recaught my attention. Using this on the screen with the bigger size sure does give me the same visual representation as on the other computer, however, when I save this to a PVSM, it still saves the height of “916”, although it is locked to “796” in the GUI. If I generate the images with this (we have that automated), it does not respect the locked height either.

<Property name="ViewSize" id="32297.ViewSize" number_of_elements="2">
        <Element index="0" value="1612"/>
        <Element index="1" value="916"/>

It appears to be a bug, after all this is what the option should be doing, right?
Using Paraview 5.10.1 here.

Can you share a complete statefile as well as resulting screenshots from both machines ?

Uh, unfortunately not right away, I’d have to prepare something not confidential, but I can do that.

However, what is “missing”/not working you can do on any machine: build a layout with some view, save a PVSM. Use the Lock View Size option with some smaller resolution and save another State. Looking in the state files and searching “ViewSize” will give the same values, where you should see different resolutions in each state, or not?

I have not taken a look at this section of the code, so take my comments with a grain of salt. I played around with this a bit in ParaView 5.12.0.

I think when you load a state from the PV GUI, it ignores the ViewSize property. The view size is dictated by the display of the window, and it would be problematic to attempt to resize the GUI to match the state. However, if you load the state from a script (e.g., from pvpython or pvbatch), then the render window created will match this view size.

My recommendation is to use preview mode (ViewPreview) instead of lock view size. The two are similar functionality. Lock view size is an older feature that is mainly kept around for the testing framework. Preview mode is newer and designed specifically for what you are trying to do: keep the view consistent from run to run. And preview mode is saved in the state, so when you load the state again you will get the preview mode back.

That seems to be the behavior of the GUI and the ViewSize, yes. Since we create the images headless here, this setting in the state is dictating what the size of the outcomming image is.

The preview mode looks very promosing Kenneth, thank you very much for the pointer. My first impression is, that I could at least create a “preview” with the dimensions from my smaller screen and use that as well on my bigger screen. Then they should always be consistent. I am not sure yet, what happens if I set my smaller screen to a bigger preview size. I will play around with that option and see if it works as expected. I will report back here once I tested it.

Hello experts,
I am coming back to this topic with new insights. First of all, the Preview feature does work as expected and the images coming out are as big as specified. Now, what I need for ultimate bliss is “upscaling”. It appears, we can always Preview in a smaller size, but never in a bigger size than the screen we have. In my example I have a bigger screen at work (height = 976 px) than at home (height = 792 px). I can always preview down to 792 px to get consistent images, that is good. But …

Whats the reasoning behind the upper limitation? I can use PV in a windowed mode on two screens for example to get a ultra wide view and any server doing headless image creation does not care about the size either. Can the upper size limit be lifted to produce images of any dimension we want?

You can save images at a higher resolution than your screen affords without problem. Just set the size to whatever you want in the image option dialog, and ParaView will save an image of that size.

It’s not clear to me how you could preview an image larger than your screen. You would only be able to see what your screen allows, so perhaps with additional controls to move around in the 2D image space, which seems like it could be awkward and confusing - it’s like a different kind of zoom.

Wait. You are right, sorry.
I tested it once and it appeared wrong at first, but previewing in any size is allowed and scales the view with the target aspect ratio to fit onto the screen. When saving, this size is respected. Well … then, it appears nothing missing for ultimate bliss :slight_smile: