• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Random pixels from a BufferedImage...

 
tim charles
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What would be the most efficient way to grab a number of random pixels (RGB value) from a BufferedImage. Preferably equidistant from each other.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By "random", do you mean actually random x and y values, or just that they could be any x and y values? For the latter, check out the getRGB(int, int) method. The former could be implemented by feeding random values into the two parameters of that method, although that wouldn't address the equidistant constraint.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic