Random pixel sampling

I have a 1x50 TOP and I want to pick ten random pixels from it and pack them into a 1x10 TOP and I’m not sure how to do it. Any help would be appreciated as I’ve been stuck on this for quite a while.

Hey EtherDrawn,

this calls for the Remap TOP. First Input is your 1x50 image (in the example of the screenshot a ramp with some colors) and the second input a 1x10 Noise TOP set to random.
The parameter to change on the remap is the Resolution Source parameter which should point to the “UV Image” (the second input).
The Remap TOP will use the value from the pixels in the second input as a lookup into the first input returning in this instance a random selection of points.

Hope this makes sense


Thanks yeah that makes perfect sense. Thank you so much. Will try it out as soon as I can and let you know how I get on.

Worked perfectly. Thanks so much, I didn’t know about the UV image for the resolution source. Will be using this a lot in the future I think.

1 Like

Hey @EtherDrawn,

@greg just pointed out that you would want to set the Input Smoothness on the Common Page of the Remap TOP to “Nearest Pixel” - otherwise the values of the inputs will be interpolated or mipmapped and the remap hence not returning the “precise” or expected values.


1 Like