Update image sampler

hi
i am trying to create an animation with a slider
in my gh definition i have an image sampler and i want it to sample a sequence of images
i found an C# component from flo frank (blickfeld7) that allows me to externally input the file path and u v domain. but the image sampler does not automaticly update!

Does anybody have an idea how to make it update automaticly or maybe some other solution that would work?

update image sampler.gh (73.7 KB)

thanks in advance for any ideas :slight_smile:

Just use that


Import Image (dont forget to put a region of size 0 to 1 to the image) you will have to transform the color to brightness, beware by default Grasshopper transform color to points ranging to a cube centered at 0 with a size of 2.

hi Laurent
thanks for your quick response
I have 6 images to sample each at a pretty high resolution
Tried this solution but it is just too slow. especially since i have 100 frames * 6 images to sample :rofl:

The othere solution will be to use C# or whatever, it mustn’t be too complicated.

Bitmap bitmap = new Bitmap(File);
Color color = bitmap.GetPixel(x,y);
float fl color.GetBrightnes();

Just have to make some transformation for x and Y, some list management … If you can’t code, I can do it.

hi again
I have absolutly no clue of coding :sweat_smile:
if you would be so friendly. I would be very thankfull!

Here a solution, hope it works
UVs must be betwen 0 to 1 in XY plane.
update image sampler.gh (71.0 KB)

2 Likes

hi
first of all thanks for your effort

i have been trying for the last hour to manage on my own but i have an issue and don’t know what is going wrong

i am trying to move these squares acording to information from the image (the mesh seen in the picture is also with color from your component) but it doesn’t add up. it has values but why don’t they match up? :neutral_face:

not lining up.gh (15.0 KB)

here is the image i am using

You have some problem with coordinates.
Image must be
image
Real image with Pixel are
image
Surface are not really oriented

Your mesh is bad, you didn’t place the faces well, On purpose ???
My image


Your image

nope :rofl:
still new to GH
mistakes hapen ^^

but finally figured it out
thanks for all your help

the component you postet at the beginning works like a charm

the mistake is not he mesh but the color. For a mesh in Rhino the colors are at the vertices. So you must do something like that
not lining up.gh (19.2 KB)

oh thats good to know
that i didn’t figure out

I went a completly different way and created the mesh diffrently

I hope everything is now working and I didn’t orient you in a wrong way😅
What was useful for me here was to make a high contrast image to see where was the problem.

no not at all :slight_smile: helped a lot
there is just so much to know about gh and always good to learn new things