algorithmic modeling for Rhino
http://www.grasshopper3d.com/forum/topics/image-sampling-3?commentI...
Image sampler returns the brightness of particular pixels inside of assigned picture, related to particular point in Rhino. It can return saturation, RGB colors...,
Thank's Felipe.... i just see this definition, but i want to work with a color, and RGB colour have 3 value, and i don't know how i can use this 3 value!
Hi Paolo,
it is an interesting problem because your image is basically a custom gradient mapped onto a grey-scale image. These images often have custom gradients (red=hot, blue=cold) to make it friendlier for humans to read them, but it makes it a lot harder to programmatically extract the information. Is there any chance you'd have access to the original data? If yes, then use the greyscale image and sample Brightness using the Image Sampler.
If no, then you need to find a way to convert colours into single numbers. A not very fast, not very accurate but relatively secure way of doing this would be to duplicate the gradient in Grasshopper and generate a related set of colours and numbers. Then use Key lookup to find your actual values using the [Find Similar Member] component.
I'll try and come up with an example later today (though no promises).
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Hi Erick, this is exactly what I meant. Can I see how you built the algorithm? It's can help me much. I thank you in advance
I came up with one solution, not very flexible though. Basically what you do is amplify the mesh non-linearly. For example using a power function. This will stretch the mesh vertically and it will stretch it more so where the mesh is high to begin with.
Then you use [Populate Geometry] to place points on this mesh, and due to the nature of the population algorithm there will be more points (on average) on very steep mesh faces than on very horizontal mesh faces. By projecting these points back onto the XY plane, you get a gradient map (see attached).
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Hi all,
Reviving this post - wondering if there might be any better methods to do this four years later..
or if anyone has tried other approaches since.
Thank you very much,
Tim
I did a similar color lookup translation in this thread, May, 2017:
Image Sampler with rgba images
http://www.grasshopper3d.com/forum/topics/image-sampler-with-rgba-i...
Hi Joseph,
Thanks a lot for the response!
It seems to me like translating the extracted color information to variable density of point distribution would require something different from translating it to radii of spheres (the latter would be a single value to single value mapping).
Any thoughts on translating the information to density distribution?
Thanks again,
Tim
Hi Joseph,
Thanks for your response again;
I implemented and altered your approach a bit to work with what I had (a colored mesh).
I had thought of this idea, but was unsure of the somewhat discrete result it would return:
The amount of points distributed in a local area (or a single circle in this case) is limited by the number of steps the domain is allowed to offer, and thus, like what you showed in the image, the distribution is essentially striated and not really continuous across the entire global area.
Please find attached if you or any other would like to take a look and give further suggestions.
Thank you!
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by