I am trying to extract RGB colours from the viewport view. At the moment, the only I find is to export the viewport to a image file on the hard drive and reload it into an Image. Is there a way to load an image in the Grasshopper cache directly as shown in the viewport without having to go through the export to file/hard drive:
VIEWPORT VIEW > GRASSHOPPER [img] > Other GH operations
Thank you Kahled, this is exactly what I was looking for. It works like a charm except for when the viewport is rendered (using Raytraced) which is the main point of my exercise. Is there a specific reason for it?
Very grateful for your help!
Hi Khaled Sighier,
The code you very kindly shared works very well with any view type apart from the RayTraced view. I cannot find any help on google to associate GetView with Raytraced. Would you have an idea how I can resolved this?
Many thanks in advance.
Oh, but it works (without new coding and as one click solution)
From _PackageManager install Human coded by @andheum
From Bitmap+ | Food4Rhino coded by @DavidMans
Or bitmap component as recommended by Seghier
First part, set path to directory
In panel, part two represents filename “!” Between filename and extension render start time is added (for better file identification only)
Activate viewport for rendering
Change viewport mode for preview, e.g Raytraced with low count passes.
’!’ Main function If True raytraced render starts (e.g. with higher passes)
Loads gives path of last raytraced image
Loads image with Bitmap+ component and can be edited, layer, filter and other and can be
saved ‘!’ This is only a millionth fraction of the possibilities for automation.