Viewcapturetofile Does not look the same as viewport, materials darker, geometry overlaps

Hi, I have developed several methods for animation over the years by exporting high resolution images of baked geometry from the Rhino viewport using Rhino Common with Rhino python, working well with Rhino 5.

pic = Rhino.Display.RhinoView.CaptureToBitmap(view,viewSize, attr)
System.Drawing.Bitmap.Save(pic , exportFilePath)

However, now when I use the same method, there is a clear difference between the bitmap captured, and visual appearance of the viewport. Noticeably some of the materials look much darker and there appears to be surface collisions, even when surface collisions are not visible in viewport. Any reason why this could be?

Hi Lauren - I don’t know but I’ll see if I can reproduce this. @rajaa, do you have any ideas?

-Pascal

FWIW darker rendering sounds like gamma / linear workflow issue.

Hello all, thanks for the help. Just to be clear: ViewCaptureToFile executed from CommandLine and RhinoView.CaptureToBitmap output different images of same viewport where displaymode/attributes are constant. After a few tests it seems that there are sometimes different materials ascribed in output bitmap than in viewport, especially when objects have been ascribed a material different than their layer. Not sure that this can explain the appearance of surface collisions however. Possibly, in the case where colliding objects have the same material in view, but different materials when export to bitmap.

Happy to provide example files or codes I am using, or sample exports. thanks!