Export bitmap with controlled canvas

Hello,

I would like to generate a JPEG or PNG from a viewport with a custom resolution and anti-aliasing. The custom resolution part I have found out how ( -ViewCaptureToFile ). Anti-aliasing is achievable by generating a much larger image than needed an then downsampling in an image editor.
My main problem is controlling the exact canvas of the image. I can somehow control it by resizing the viewport, I can even control its dimensions. I can also try my best is custom Zoom and Pan so that the object fits perfectly. But these are always methods much less accurate than desired.
If there was some kind of rectangle that one could use for framing, the proportion and exact location of the exported object within the frame, would be resolved. (and anti-aliasing would also be welcome)

Thanks for bringing this up. I believe the width and height should be editable when using a floating viewport which is not constrained by any adjacent borders. I filed this as http://mcneel.myjetbrains.com/youtrack/issue/MR-2745 for future reference.

In the meantime, the best possible work around I found was to use NewFloatingViewport and then maximize the view to your screen. The aspect ratio and dimensions will then be what your screen is set to.

Regarding the AA request. Can you explain more about what you’d like to have? Would it be a command option for -viewcapturetofile? The display uses AA already so maybe this is a factor only when saving out larger images. Any screenshots or files you can share would be good to see too. Thanks.

Setting the exported image dimensions with the viewport properties does not seem to be a perfect choice, as framing the contents is not straightforwards. The best option would be to use “Zoom, Selection”, but this always takes into account a padding value which I cannot control.

I suggest to be able to use a “Use selection Bounding Box”. That way, a user would select any object(s), and Rhino would calculate the Bounding Box, which in turn would be exact limits of the exported image.

I also remembered another important suggestion: Have Rhino constrain the exported image dimensions so that the proportion is the same of the afore mentioned Bounding Box.

Regarding AA: I was preparing some screenshots but it seems that exported images have AA, so I feel a little mixed up on the subject. I will research more and maybe open another topic on it, if needed.

Thanks for the extra info. Have you tried the Print command yet? There’s a Window option that you can set and adjust. You could then print a pdf in the lower left corner of the print dialog. The paper size section will control your aspect ratio for the window you drag out and move around.

I actually tried that as a first option. But setting a specific paper size is too cumbersome, and raster resolution is dependent on gigantic paper sizes, which I would then have to rasterise with OSX preview or Photoshop. Not the smoothest workflow.