"ViewCaptureToFile" destructs color values


Why does the “ViewCaptureToFile” (same as the “ScreenCaptureToFile”) command destructs original color RGB values?
In the example on “Top” viewport lies rectangle object with pure blue color applied to it (meaning RGB = 0,0,255), but when I ViewCaptureToFile it I am getting skew color (now RGB = 3,41,215). Whereas if I take a screenshot by CMD+Shift+4 I get a valid result as the original image has (RGB = 0,0,255). So what happens underhood of the “ViewCaptureToFile” command and how to fix it.

P.S.: I am using the Mac version of Rhino. The result does not depends of a “Color Profile” selected for my display (Preferences > Displays > Colour Profile)

Blue.gh (11.3 KB)

Assigned to Grasshopper category

Set in the Rhino document Rendering panel the gamma to 1.0. What you see is likely gamma correction being applied.

Hi @nathanletwory! In my example above I have gamma = 1 (DocumentProperties > Render > Gamma), meanging there’s no effect of gamma. Something also alters the original color.
And as I know Gamma can’t add a value for one of the RGB channels if it equals 0. Meaning I have pure blue color R=0,G=0,B=255 and when I am altering gamma it only affects on B channel, but I get some values for R and G channels.

Also I should mention that use “Shading mode” with shading settings of “Color and material” option selected as “Rendering material”. Maybe I sould utilise another mode?

Furthermore, if switch from diffuse input of “Create Material” node to the “Emission” we observe another color output:

did you use any photo editing software to crop the captured viewport? also what file formats did you use?
Generally photoshop embeds a color profile is some formats.

I tried PNGs, without cropping (zoomed all the way), make sure that you have the color set to “emission” to avoid Rhino Viewport shading. I got both results at 0,0,255 (It doesn’t mean anything since I’m running a PC)

No, it is the original output made by "ViewCaptureToFile” commad (there is no cropping, I just shrink up Rhino viewport to the image)

I have tried PNG and JPEG - the same result at the end

Yeah, as you could note in the screenshot attached above I have tried emission as well (connection to “Ke” input), but anyway a wrong result of RGB value. For some reason only screenshot made by Mac (cmd+shift+4) gives valid RGB values, but inconvenient utilising this method is that I can’t make precise cropping afterwards

Seems this problem only mac vertion. Should get Dev confirmation

@nathanletwory Seems there is no a solution, would you report is as a bug?

If you use regular Rendered mode you’ll get the results you expect.

Not truly:(
Unhappy, I get the same corrupted result, even if to use the “Rendered” display mode.

1 Like

I guess for Rendered mode you should keep gamma at 2.20, which is what I had when I quickly tested. Just redid it, on the left is Shaded, on the right is Rendered

And when I do a _ViewCaptureToFile on the Rendered viewport the values are the expected (0, 0, 255):

Addendum: Perhaps an important part is that I have skylight on. Best I guess is to have just a simple white skylight environment, meaning set background to solid white, uncheck custom reflection environment, check skylight, but uncheck custom skylight environment. With the default scene lighting when you turn all lights off you’ll get slightly darker because that is just the character of the light being used. Check with a mid-gray (127, 127, 127) and test with both 2.20 and 1.0 gamma

I get for the input (127, 127, 127) the same output for both on a Rendered ViewCaptureToFile