Can't "print" to a png file while keeping the transparency

Hello friends,

I’m trying to “print” to a PNG file while keeping the transparency.

The print preview shows the white and gray transparency grid but when I export to PNG, the background turns out either black or white, never transparent.

My preferred way would be to render the image using the Rhino Renderer but I need an output file of 12000px by 136px and I didn’t see there is a way to get the render window to render only the needed part and to do it precisely at the pixel level like the print tool can. would love to know if there is a way.

Thanks in advance for you help (:

Roy.

Hi Roy - - use ViewCaptureToFile for this. Does that get you what you need?

-Pascal

Hi Pascal, Thank you, unfortunately it doesn’t, since I have a rectangle of 12000mm by 136mm and I’m trying to export it exactly as it is to a file turning millimetres to pixels. the print dialog allows to set the print window to match that rectangle exactly.

Capturing to file doesn’t allow setting the capture window’s position and setting the viewport’s dimensions to those dimensions would also not allow positioning that rectangle perfectly inside the viewport.

Petty surprised the print dialog doesn’t allow this.

Hi Roy - if the view is an elevation/parallel view, try this:

  • Set your viewport size (is that 1200, or 12000, by 136?) to the same aspect ratio as the rectangle (in viewport properties).
  • SetZoomExtentsBorder to 1 for parallel views.
  • Zoom Extents (assuming the rectangle is the largest thing in view, otherwise Zoom Selected)
  • ViewCaptureToFile

?

-Pascal

Thanks Pascal,

Nice strategy but it’s actually 12,000 :slight_smile:

I’ve tried diving it by 10 to get 1200 to be able to fit it on the screen but then 136 will turn into 13.6 and that won’t be accepted as a decimal number.

Thank you @pascal, I’ve managed to use most of the method you’ve suggested and just ended up rendering the viewport 12000px width and then I cropped the image afterwards to match 136px since the viewport didn’t match the the rendering dimensions I’ve put in.

I think a feature like a “define window to print” for rendering could be very useful at times. it could solve all issues like that one, especially when it’s the only one that provides a fully rendered image right? (compared to the “capture to file” command and the print command).

Hi Roy -
The issue with the Print to image workflow not having transparency is on our list as RH-10758.
I have added this thread to be notified when the feature gets introduced.

That sounds like the RenderWindow command, no?
-wim

Hi Wim, Thank you.

The issue with the Print to image workflow not having transparency is on our list as RH-10758.
I have added this thread to be notified when the feature gets introduced.

That’s cool.

That sounds like the RenderWindow command, no?

There are two big differences, The print window:

Allows you to snap to objects.
and allows you to pan/zoom the viewport while you drag and define the window.

The RenderWindow command doesn’t, so you can’t get accurate dimenstions by snapping to objects and you’re limited to the dimensions of your viewable viewport’s resolution, and it also won’t keep the ratio of the window if you’d like to, like the print window does.

I think it would be a great feature if the RenderWindow would define its window in the same way the print window does.