Grasshopper

algorithmic modeling for Rhino

Hi,

I know this has been asked for before, but anyway -

It would be nice to be able to output the pixel dimensions of an image captured by the Image Sampler component so they can be used for something. 

My suggestion would be to output the pixel dimensions of the image in the image sampler if there was an image referenced but nothing connected to the input (instead of the "no image data collected..." currently).  That way one could, for example, grab an image with the sampler, make a copy of the component, use the copy with no input to create a 2D series of sample points based on the pixel dimensions, and plug that into the original...

As to how the data is output, I suppose that should be a 2D domain...  I seem to remember a discussion whether that domain should start at 0 or 1...

I can of course grab the image with a separate script component using System.Drawing.Image.FromFile and then get the.Width and .Height, but that's more of a pain...  anyway, just a suggestion... 

Thanks for all the great work as always,

--Mitch

Oh, and btw, this would also have an advantage if the image was saved in the file, as using an additional component with a scripted file path would likely be invalidated if the file was opened somewhere else.

Views: 932

Replies to This Discussion

Personally, I always normalize the image sampler domain so that the definition will work with any image regardless of dimensions. Then my image output size is always 1x1 and I sample within that domain.

 

But I agree, it would be nice to have the sizes there so that one could get the aspect ratio of the image.

It also would be nice if I want to sample the pixels 1 for 1 or some multiple...  --Mitch

Hi Mitch,

I think this will be part of a larger effort of adding a Bitmap data type to Grasshopper.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service