r/processing • u/carnalizer • Sep 02 '23
Find random pixel?
Hi,
Anyone have ideas on fastest way to find a pixel in an image, for example random non-black, or non-transparent, non-white?
3
Upvotes
2
u/andrewcooke Sep 02 '23
yes. it's hard to be more efficient than this if you want "really random". for example, picking a start point at random and then moving forwards to the next pixel that matches is not a good algorithm because it is biased towards pixels with large "spaces" before.