Colour from file

Hi there,

Im looking to achieve something that I suspect is very simple:
to take a series of jpegs files of individual colour sample squares, and use a colour sampler to extract their data.

Initially this is to merge them in to a a combined simple colour, as if they were all paint buckets mixed together, but also to have their individual data to experiment with. I am getting confused by what the ‘image sampler’ function whats me to provide it as input data, and how to extract rgb data from the image sampler.

Any directional help much appreciated.

Thankyou, sorry not to provide an example file but I cannot get anything to work as of yet!

The input is the x and y position of the pixel, starting from top left i believe.The output by default is red,green,blue values but can be changed in component settings.

So connecting a panel with “0,0” would get the top left pixel.

1 Like

Thanks great help, have got that working now. Sometimes it’s so confusing trying to figure the simplest thing out! With the rgb list, is t possible to generate a colour preview within grasshopper?

Try the Legend component. It’s meant for something else, but it’ll show colours on the canvas.

You could probably also use the MetaHopper plugin to assign a colour to a panel or group programmatically.